一、安装Nexus
docker run -d --name nexus \
--restart=always \
--privileged=true \
-p 30024:8081 \
-p 30025:8082 \
-v /home/$USER/dockerfile/nexus/data/nexus-data:/nexus-data \
sonatype/nexus3:3.45.0
二、创建docker镜像仓库
1.创建
2.选择代理仓库
3.填写信息
4.添加docker权限
5.创建角色和用户(仅使用代理功能无需创建)
6.配置/etc/docker/daemon.json文件
{
"registry-mirrors": [
"https://hub-mirror.c.163.com",
"http://10.10.11.100:30025"
],
"insecure-registries": ["10.10.11.100:30025"]
}
重载配置
systemctl daemon-reload
重启docker服务
systemctl restart docker
三、测试
myuser@ubuntu:/etc/docker$ docker pull 10.10.11.100:30025/helloz/transmission:v1.3
v1.3: Pulling from helloz/transmission
ba3557a56b15: Pull complete
d9b286767b1b: Pull complete
90d275dc7c03: Pull complete
4cbcf4bbde0c: Pull complete
Digest: sha256:2ac88659895b803a461f172efce5bf9f6812f2278a55cbe72d91d7675744d1e1
Status: Downloaded newer image for 10.10.11.100:30025/helloz/transmission:v1.3
10.10.11.100:30025/helloz/transmission:v1.3
查看Nexus可以看到已经下载了该镜像
评论 (0)