docker-registry私有仓库

1150人浏览 / 0人评论

一、docker仓库

docker官方仓库、第三方仓库、docker私有仓库。

本地镜像更安全、更方便。

下载镜像命令:

[root@1 nginx]# docker run -d -p 5000:5000 --restart=always --name regis -v /opt/myregistry:/var/lib/registry registry
 

 docker私有仓库

1、打标签

docker tag nginx:v1  10.0.0.11:5000/

docker push 10.0.0.11:5000/nginx:v1

打标签

[root@1 nginx]# docker tag nginxasd:latest 49.234.14.64:5000/nginxasd:latest

上传

[root@1 nginx]# docker image push 49.234.14.64:5000/nginxasd:latest
 

[root@1 nginx]# docker image push 49.234.14.64:80/nginxasd:latest
The push refers to a repository [49.234.14.64:80/nginxasd]
Get https://49.234.14.64:80/v1/_ping: http: server gave HTTP response to HTTPS client
报错

修复

[root@1 nginx]# cat /etc/docker/daemon.json{
{
  "registry-mirrors": ["https://registry.docker-cn.com"],
  "insecure-registries": ["49.234.14.64:80"]
}

重启docker

 

 

下载镜像

docker pull 49.234.14.64:5000/nginxasd:latest

 

查看镜像:

http://49.234.14.64/v2/_catalog

 

查看镜像的版本:

http://49.234.14.64/v2/nginx/tags/list

 

删除镜像:

[root@1 nginx]# docker exec -it registry /bin/sh
进入到容器中

[root@1 nginx]# docker exec -it registry /bin/sh
/ # cat /etc/os-release 
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.11.6
PRETTY_NAME="Alpine Linux v3.11"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
 

镜像位置:/var/lib/registry/docker/registry/v2/repositories # pwd

 

 

配置认证registry

 

 

全部评论