5

部署Nexus[docker-compose]

 1 year ago
source link: https://blog.51cto.com/mayi/5841760
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

部署Nexus[docker-compose]

精选 原创

#安装docker
[root@nexus ~]# yum -y install docker

#安装docker-compose
[root@nexus ~]# curl -L https://github.com/docker/compose/releases/download/1.27.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
[root@nexus ~]# sudo chmod +x /usr/local/bin/docker-compose
[root@nexus ~]# docker-compose --version

#创建yml文件
[root@nexus ~]# cat > docker-compose.yml << EOF
version: '3'
services:
nexus:
image: sonatype/nexus3
restart: always
container_name: nexus
environment:
- TZ=Asia/Shanghai
ports:
- '8081:8081'
volumes:
- /data/nexus:/nexus-data
EOF

#创建目录
[root@nexus ~]# mkdir -p /data/nexus
[root@nexus ~]# chmod 777 /data/nexus

#启动服务
[root@nexus ~]# docker-compose up -d
[root@nexus ~]# docker ps -a

#访问地址: http://192.168.10.50:8081

#查看密码
[root@nexus ~]# docker exec nexus cat /nexus-data/admin-password
5b7017b6-f5b0-4440-9e50-3390c0032453


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK