1、Docker CE安装
参考:https://www.cnblogs.com/a120608yby/p/9883175.html
2、Docker Compose安装
参考:https://www.cnblogs.com/a120608yby/p/14582853.html
3、部署Nexus
# vim docker-compose.yaml version: '3.7' services: nexus: image: sonatype/nexus3:latest container_name: nexus restart: always ports: - 8081:8081 networks: - ops_default volumes: - ./data:/nexus-data - /etc/localtime:/etc/localtime:ro networks: ops_default: external: true # 创建网络 docker network create ops_default # 创建数据目录并授权 mkdir /data/docker/docker-nexus/data chown -R 200.200 /data/docker/docker-nexus/data # 启动服务 docker compose up -d # 查看服务状态 docker compose ps
4、Web访问
访问地址:http://部署主机IP:8081/ 账号:admin 初始密码为数据目录下的admin.password内容
参考:
https://github.com/sonatype/docker-nexus3