部署nexus
代码语言:javascript
复制docker pull sonatype/nexus3
mkdir /data/nexus-data
chown -R 200 /data/nexus-data
docker run -d --name nexus3 --restart=always -p 8081:8081 -p 8082:8082 -v /data/nexus-data:/nexus-data sonatype/nexus3
代码语言:javascript
复制version: "3"
services:
nexus:
image: sonatype/nexus3:latest
container_name: nexus
hostname: nexus
restart: always
ports:
- 8081:8081
- 8082:8082
volumes:
- /data/nexus-data:/nexus-data
创建docker仓库
代码语言:javascript
复制设置 --> Repositories --> Create repository --> docker(hosted)
Name:输入创建的名字,如docker-repo
HTTP:8082
启动Enable Docker V1 API
连接仓库
代码语言:javascript
复制vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://hk0l6i5k.mirror.aliyuncs.com"],
"insecure-registries": ["192.168.1.76:8082"]
}
登录仓库
代码语言:javascript
复制docker login -u admin -p 123456 192.168.1.76:8082