Docker 官方仓库
2.11.1. Docker 官方仓库
2.11.1.1. 登陆仓库
登录
$ sudo docker login Username: netkiller Password: Email: netkiller@msn.com Login Succeeded
2.11.1.2. 获取镜像
docker pull ubuntu:14.04
2.11.1.3. 上传镜像
docker tag friendlyhello username/repository:tag docker push username/repository:tag
2.11.2. 私有仓库
2.11.2.1. 搭建私有仓库
搭建私有仓库只需两步
docker pull registry docker run -d -p 5000:5000 -v /opt/registry:/var/lib/registry --name registry registry
操作演示
neo@ubuntu:~$ docker pull registry Using default tag: latest latest: Pulling from library/registry 169185f82c45: Pull complete 046e2d030894: Pull complete 188836fddeeb: Pull complete 832744537747: Pull complete 7ceea07e80be: Pull complete Digest: sha256:870474507964d8e7d8c3b53bcfa738e3356d2747a42adad26d0d81ef4479eb1b Status: Downloaded newer image for registry:latest neo@ubuntu:~$ docker run -d -p 5000:5000 -v /opt/registry:/tmp/registry registry 38a6d3b5e18e378b7765fa00374426db3a06c64f4b9219a1f85dc42a6a66ef28 neo@ubuntu:~$ docker ps | grep registry 38a6d3b5e18e registry "/entrypoint.sh /etc…" 35 seconds ago Up 33 seconds 0.0.0.0:5000->5000/tcp
设置允许http协议访问,有两种方式,一种是修改 /etc/docker/daemo