1,编写 Dockerfile
FROM java:8
MAINTAINER kason < 你的邮箱 @88.com>
ADD admin-api-0.0.1-SNAPSHOT.jar test.jar
EXPOSE 7001
ENTRYPOINT ["java","-jar","test.jar"]
2,生成镜像
docker build -t bl-play-api-admin-test:1.0.0 .
3, 运行镜像,生成容器
docker run -d -p 7001:7001 bl-play-api-admin-test:1.0.0
能够失常拜访:
4,登录 dockerhub
docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: wx**88
Password:
Login Succeeded
Logging in with your password grants your terminal complete access to your account.
For better security, log in with a limited-privilege personal access token. Learn more at https://docs.docker.com/go/access-tokens/
5,给镜像打 tag
docker tag w****8/bl-play-api-admin-test:1.0.0 w****8/bl-api-api-admin-test:1.0.0
6,推送打过 tag 的镜像
docker push w****8/bl-api-api-admin-test:1.0.0
7,推送胜利
8, 批改文件后从新成成镜像并推送
docker build -t bl-play-api-admin-test:1.0.1 .
docker tag bl-play-api-admin-test:1.0.1 w****8/bl-api-api-admin-test:1.0.1
docker push w****8/bl-api-api-admin-test:1.0.1
9, 推送胜利
10,如何部署动态文件
能够参考:https://amosannn.github.io/20…