Nexus3 配置 docker 仓库

1、启动脚本,增加一个 8082 端口给 docker 仓库

vim start.sh
 
# 内容
docker rm -f nexus || true
docker run --name nexus \
-p 8081:8081 \
-p 8082:8082 \
-v /docker/nexus/nexus-data:/nexus-data \
--restart=always \
-d sonatype/nexus3

2、创建一个 docker 仓库,这里选择 docker (hosted)

3、输入仓库名字,HTTP 端口号,允许与 API 交互

4、配置 Realms

5、在另一机器登陆仓库,先配置 docker

{
    "registry-mirrors": ["http://hub-mirror.c.163.com"],
    "insecure-registries":["harbor.mshxuyi.com","192.168.2.107:8082"]
}

6、重启 docker 

# 重新加载(有些Docker版本需要)
systemctl daemon-reload

# 重启
systemctl restart docker

# 登陆成功
[root@jenkins ~]# docker login -u admin -p admin123 192.168.2.107:8082
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

7、上传镜像

# 拉取一个镜像
[root@jenkins ~]# docker pull busybox

# 给镜像打 tag
[root@jenkins ~]# docker tag busybox 192.168.2.107:8082/busybox:v1

# 上传
[root@jenkins ~]# docker push 192.168.2.107:8082/busybox:v1

8、查看,成功显示

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值