nexues 创建 docker register

首先我们打开nexus:


nexues 创建 docker register_第1张图片

创建一个docker hosted仓库:

nexues 创建 docker register_第2张图片

取个名,给个端口号,创建仓库,docker push 请求是https请求,我的nexus部署在内网,也不需要https,
所以在docker里添加http访问白名单:

vim /etc/docker/daemon.json 添加内容 "insecure-registries":["10.30.80.200:5000"],把nexus的ip和刚才设置的端口号添加到以下文件中:

{
  "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"],
  "exec-opts": ["native.cgroupdriver=cgroupfs"],
  "log-driver": "json-file",
  "insecure-registries":["10.30.80.200:5000"],
  "log-opts": {
    "max-size": "100m"
  }
}

重启docker

systemctl daemon-reload && systemctl restart docker

测试以下上传镜像:

# [root@wh01-vmapp-80-200 ~]# docker login 10.30.80.105:8089
# Username: admin
# Password: 
# 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
# [root@wh01-vmapp-80-200 ~]# docker push 10.30.80.105:8089/defaultbackend:1.4
# The push refers to repository [10.30.80.105:8089/defaultbackend]
# d62604d5d244: Pushed 
# 1.4: digest: sha256:865b0c35e6da393b8e80b7e3799f777572399a4cff047eb02a81fa6e7a48ed4b size: 528

上面登录的账号密码就是nexus的账号密码。

你可能感兴趣的:(nexues 创建 docker register)