日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

centos利用nexus搭建局域网docker私有仓库

發布時間:2025/3/11 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 centos利用nexus搭建局域网docker私有仓库 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

centos利用nexus搭建局域網docker私有倉庫

1、官網下載nexus oss版本

https://sonatype-download.global.ssl.fastly.net/repository/downloads-prod-group/3/nexus-3.29.2-02-unix.tar.gz

[root@localhost bin]# wget https://sonatype-download.global.ssl.fastly.net/repository/downloads-prod-group/3/nexus-3.29.2-02-unix.tar.gz

2、安裝nexus以及docker

[root@localhost bin]# tar -zxvf nexus-3.29.2-02-unix.tar.gz [root@localhost bin]# yum install -y docker

3、運行nexus ,如果提示JAVA_HOME沒有設置,請安裝java的JDK環境

[root@localhost bin]# cd /opt/nexus-3.29.2-02/bin/ [root@localhost bin]# ./nexus start WARNING: ************************************************************ WARNING: Detected execution as "root" user. This is NOT recommended! WARNING: ************************************************************ Starting nexus

4、創建docker倉庫

hosted – 宿主倉庫,用戶可以 deploy 到 hosted 中,也可以手工上傳構件到 hosted 里,在 central repository 是獲取不到的,就需要手工上傳到hosted里

5、修改docker配置,重啟docker

在/etc/docker/daemon.json文件中添加下面的內容:

[root@localhost ~]# cat /etc/docker/daemon.json {"insecure-registries":["10.4.7.23:8082"] } [root@localhost ~]# systemctl daemon-reload [root@localhost ~]# systemctl restart docker [root@localhost ~]# docker info Insecure Registries: 10.4.7.23:8082 #生效了127.0.0.0/8

6、拉取并上傳docker鏡像

[root@localhost ~]# docker login 10.4.7.23:8082 //username:admin password:admin123 Username (admin): admin Password: Login Succeeded [root@localhost ~]# docker pull nginx //從官網下載docker鏡像 [root@localhost ~]# docker tag nginx 10.4.7.23:8082/nginx:1.0 [root@localhost ~]# docker push 10.4.7.23:8082/nginx:1.0 [root@localhost ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE 10.4.7.23:8082/nginx 1.0 f6d0b4767a6c 2 weeks ago 133 MB docker.io/nginx latest f6d0b4767a6c 2 weeks ago 133 MB [root@localhost ~]# docker push 10.4.7.23:8082/nginx:1.0 //將鏡像上傳至本地倉庫

7、查看局域網私有倉庫

8、從私有倉庫拉取鏡像

[root@localhost ~]# docker pull 10.4.7.23:8082/nginx:1.0 //從私有倉庫拉取docker鏡像 Trying to pull repository 10.4.7.23:8082/nginx ... 1.0: Pulling from 10.4.7.23:8082/nginx a076a628af6f: Pull complete 0732ab25fa22: Pull complete d7f36f6fe38f: Pull complete f72584a26f32: Pull complete 7125e4df9063: Pull complete Digest: sha256:0b159cd1ee1203dad901967ac55eee18c24da84ba3be384690304be93538bea8 Status: Downloaded newer image for 10.4.7.23:8082/nginx:1.0 [root@localhost ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE 10.4.7.23:8082/nginx 1.0 f6d0b4767a6c 2 weeks ago 133 MB

10.4.7.23:8082/nginx 1.0 f6d0b4767a6c 2 weeks ago 133 MB

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的centos利用nexus搭建局域网docker私有仓库的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。