群晖 docker 下nexus3 创建docker私有仓库


登录后创建Blob Stores(docker MyDockerBlobStores)

 创建docker host(可以push/pull)

 docker 代理仓库,可以是docker中央仓库也可以是阿里云仓库,也可创建多个代理仓库,只能pull

 dock组(只能pull)

 如果push 会报异常

root@JD-NAS:/var/packages/Docker/etc# docker push JD-NAS:9082/jeecg-cloud-nacos
Using default tag: latest
The push refers to repository [JD-NAS:9082/jeecg-cloud-nacos]
2f4462b822b1: Preparing 
8d248393ed62: Preparing 
98561d067715: Preparing 
a52fcbff5465: Preparing 
767f936afb51: Preparing 
error parsing HTTP 404 response body: invalid character '<' looking for beginning of value: "\n\n\n\n  404 - Nexus Repository Manager\n  \n\n\n  \n  \n  \n  \n  \n  \n  \n\n  \n\n\n\n\n
\n
\n \n Error 404\n Not Found\n
\n
\n
\n Not Found\n
\n
\n
\n\n\n\n"

 坑

1.仓库端口需要映射出来

 2.http 访问群晖docker 配置

进入目录:

/var/packages/Docker/etc

修改dockerd.json:
vim dockerd.json 
{
   "data-root" : "/var/packages/Docker/target/docker",
   "log-driver" : "db",
   "registry-mirrors" : ["https://registry.docker-cn.com"],
   "storage-driver" : "btrfs",
   "insecure-registries" : ["http://192.168.231.3:9081","http://192.168.231.3:9082","http://192.168.231.3:9083"],
   "hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"]
}

这http访问配置



"insecure-registries" : ["http://192.168.231.3:9081","http://192.168.231.3:9082","http://192.168.231.3:9083"]



不知道为啥我用本地ip访问一直超时

root@JD-NAS:/var/packages/Docker/etc# docker login 192.168.231.3:9082
Username: admin
Password:
Error response from daemon: Get "http://192.168.231.3:9082/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

所以我配置了hosts

vim /etc/hosts



root@JD-NAS:/var/packages/Docker/etc# docker login JD-NAS:9081 -u admin -p 123456
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

打包nginx

docker tag nginx:latest JD-NAS:9081/nginx:latest

root@JD-NAS:/var/packages/Docker/etc# docker push JD-NAS:9081/nginx
Using default tag: latest
The push refers to repository [JD-NAS:9081/nginx]
24037b645d66: Pushed 
d00147ef6763: Pushed 
2793e885dc34: Pushed 
8b8ecda1d12d: Pushed 
30c00b5281a1: Pushed 
3a626bb08c24: Pushed 
latest: digest: sha256:1a763cbd30ef4dbc7f8e3fa2e6670fd726f4bddb0ef58868a243c0cb8b35cde1 size: 1570

上传成功,仓库查看