Based docker build PW (nexus3)
-
Download a mirror image nexus3
docker pull sonatype/nexus3
-
The inside of the container
/var/nexus-data
mounted to the host/root/nexus-data
directory.Check whether the port number is occupied
netstat -tunlp |grep 8081
# 可以直接运行,没有则会拉取:docker run -d -p 8081:8081 --name nexus sonatype/nexus3 # 可以映射到其他端口上去 docker run -d -p 8081:8081 --name nexus -v /root/nexus-data:/var/nexus-data --restart=always sonatype/nexus3
By the above two steps to complete the build PW. Next visit
-
address
Added: Check firewall status: sudo systemctl status firewalld
# 例如 http://192.168.91.100:8081 http://ip:8081 # docker ps # docker inspect 容器id 查询容器信息 # 看日志:`docker logs mynexus` #docker inspect 50c71d7068b9 # curl 172.17.0.2:8081
The initial password prompt address, find the file, which is the initial random passwords# 查询命令如下: find / -name admin.password #查找命令 cat /var/lib/docker/volumes/af7e51a5e4afe80f992027bbe2733d7cdc6f80b23c1edbfc82eaf09e2698902e/_data/admin.password
-
Set up a new password.
Several steps above to complete the build nexus3, the follow-up article will introduce the use of nexus3.