zl程序教程

您现在的位置是:首页 >  工具

当前栏目

docker部署Nexus

Docker部署 Nexus
2023-06-13 09:14:08 时间

部署nexus

  • docker部署nexus
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
  • docker-compose部署nexus
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仓库

设置 --> Repositories --> Create repository --> docker(hosted) 
Name:输入创建的名字,如docker-repo
HTTP:8082
启动Enable Docker V1 API

连接仓库

vim /etc/docker/daemon.json

{
    "registry-mirrors": ["https://hk0l6i5k.mirror.aliyuncs.com"],
    "insecure-registries": ["192.168.1.76:8082"]
}

登录仓库

docker login -u admin -p 123456 192.168.1.76:8082