关于docker:35-镜像的发布

4次阅读

共计 500 个字符,预计需要花费 2 分钟才能阅读完成。

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/

正文完
 0