1. 本机build image,然后push

登陆Docker

docker login

发布镜像

docker push siguoya/hello-world

删除本地、从服务器下载

docker rmi siguoya/hello-world
docker pull siguoya/hello-world

2. 本机push Dockerfile,使用hook交由Docker Store来Build

https://hub.docker.com/add/automated-build/siguoya/

搭建私有的docker hub

https://hub.docker.com/_/registry/
# 一条命令搞定搭建
docker run -d -p 5000:5000 --restart always --name registry registry:2

# 立即使用
docker pull ubuntu
docker tag ubuntu localhost:5000/ubuntu
docker push localhost:5000/ubuntu

使用API来管理Registry

https://docs.docker.com/registry/spec/api/

思过崖
65 声望19 粉丝

从转行到入门,记录我的自学成长之路