Ubuntu 16.04搭建nexus管理docker image:
apt-get install openjdk-8-jdk
wget https://sonatype-download.global.ssl.fastly.net/repository/repositoryManager/3/nexus-3.17.0-01-unix.tar.gz
mkdir /usr/local/nexus317
tar zxfv nexus-3.17.0-01-unix.tar.gz -C /usr/local/nexus317
mv /usr/local/nexus317/nexus-3.12.1-01 /usr/local/nexus317/nexus3
useradd -d /home/nexus nexus
chown nexus:nexus /usr/local/nexus317 -R
vi /usr/local/nexus317/nexus3/bin/nexus.rc
run_as_user="nexus" (默认为#run_as_user="") :wq
vi /usr/local/nexus317/nexus3/etc/nexus-default.properties
nexus-context-path=/nexus
:wq
/usr/local/nexus317/nexus3/bin/nexus start
netstat -nplt | grep 8081
nexus log路径:/usr/local/nexus317/sonatype-work/log/nexus.log
访问网址:http://ip:8081/nexus 初始账号:admin 初始密码:admin123
然后可以配合nginx设置https反向代理
点击设置——Repository——Repositories——Create repository——docker(hosted)——Name:ming(随便写)——HTTP:8082,HTTPS:8083——不勾Force basic authentication(即可以匿名下载image)——Create repository
Realms——Docker Bearer Token Realm——Active (允许匿名下载)
可在Users处给上传的人创建个本地账号(也可配置LDAP),上传前需要先登录(只下载可不用登录)
客户端使用(必须通过域名访问):
安装docker略
vi /etc/hosts
10.0.0.2 docker.ming.com
:wq
vi /etc/docker/daemon.json
{ "insecure-registries": [ "docker.ming.com:8083" ] }
:wq