docker镜像迁移
- 配置
- 端口 5000
- 目录/var/lib/registry repository存储
- 目录/var 认证
# 拉取registrydocker pull registry
# 创建镜像registry目录
mkdir -p /data/docker/registry
chown -R xxx:docker /data/docker
chmod g+w /data/docker
# 创建htpasswd密码认证
mkdir -p /data/docker/auth
docker run --entrypoint htpasswd registry -Bbn root 123456 > /data/docker/auth/htpasswd
docker run --entrypoint htpasswd registry -Bbn hehuang dh139139 >> data/docker/auth/htpasswd
# 无认证方式启动
docker run -d -p 5000:5000 --restart always --name registry -v "/data:/var/lib/registry" registry
# 认证方式启动
docker run -d -p 5000:5000 --restart=always --name registry
-v /data/docker/registry:/var/lib/registry
-v /data/docker/auth:/auth
-e "REGISTRY_AUTH=htpasswd"
-e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm"
-e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd
registry
以上是 docker镜像迁移 的全部内容, 来源链接: utcz.com/z/516549.html