上传eureka的jar包至Linux服务器编写Dockerfile,并上传至Linux服务器
FROM java:8
ADD spring-cloud-eureka-security-server-0.0.1-SNAPSHOT.jar /spring-cloud-eureka-security-server.jar
RUN
bash -c
'touch /spring-cloud-eureka-security-server.jar'
EXPOSE 8004
ENTRYPOINT
["java",
"-jar",
"/spring-cloud-eureka-security-server.jar"]
MAINTAINER liuzhiyong
构建镜像
docker build -t eureka/eureka-security:v1
.
查看镜像是否制作成功
docker images
创建容器
docker run -di -p 8004:8004 eureka/eureka-security:v1
页面访问
http://192.168.17.133:8004/