群晖 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<!DOCTYPE html>\n<html>\n<head>\n  <title>404 - Nexus Repository Manager</title>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\n\n\n  <!--[if lt IE 9]>\n  <script>(new Image).src=\"http://JD-NAS:9082/favicon.ico?3.9.0-01\"</script>\n  <![endif]-->\n  <link rel=\"icon\" type=\"image/png\" href=\"http://JD-NAS:9082/favicon-32x32.png?3.9.0-01\" sizes=\"32x32\">\n  <link rel=\"mask-icon\" href=\"http://JD-NAS:9082/safari-pinned-tab.svg?3.9.0-01\" color=\"#5bbad5\">\n  <link rel=\"icon\" type=\"image/png\" href=\"http://JD-NAS:9082/favicon-16x16.png?3.9.0-01\" sizes=\"16x16\">\n  <link rel=\"shortcut icon\" href=\"http://JD-NAS:9082/favicon.ico?3.9.0-01\">\n  <meta name=\"msapplication-TileImage\" content=\"http://JD-NAS:9082/mstile-144x144.png?3.9.0-01\">\n  <meta name=\"msapplication-TileColor\" content=\"#00a300\">\n\n  <link rel=\"stylesheet\" type=\"text/css\" href=\"http://JD-NAS:9082/static/css/nexus-content.css?3.9.0-01\"/>\n</head>\n<body>\n<div class=\"nexus-header\">\n  <a href=\"http://JD-NAS:9082\">\n    <div class=\"product-logo\">\n      <img src=\"http://JD-NAS:9082/static/images/nexus.png?3.9.0-01\"/>\n    </div>\n    <div class=\"product-id\">\n      <div class=\"product-id__line-1\">\n        <span class=\"product-name\">Nexus Repository Manager</span>\n      </div>\n      <div class=\"product-id__line-2\">\n        <span class=\"product-spec\">OSS 3.9.0-01</span>\n      </div>\n    </div>\n  </a>\n</div>\n\n<div class=\"nexus-body\">\n  <div class=\"content-header\">\n    <img src=\"http://JD-NAS:9082/static/rapture/resources/icons/x32/exclamation.png?3.9.0-01\"/>\n    <span class=\"title\">Error 404</span>\n    <span class=\"description\">Not Found</span>\n  </div>\n  <div class=\"content-body\">\n    <div class=\"content-section\">\n      Not Found\n    </div>\n      </div>\n</div>\n</body>\n</html>\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

上传成功,仓库查看


 

 




posted @ 2022-04-24 15:33  简单的李  阅读(877)  评论(0编辑  收藏  举报