SoFunction
Updated on 2025-03-09

Mac's process of deploying Nexus3 with one click through docker

Mac deploys Nexus3 with one click through docker

1. Preface

Programmer development tasks are already quite complicated. If you build various open source software and need to search for configurations, you will basically have gray hair almost stripped off. How to find a girlfriend? Have you always been with the Five Girls? So I was the first person to try it out and tried some tricks, and wrote some simple shell scripts to help us quickly build servers. As long as the apes follow the routine, they can basically deploy services quickly, and there is also "Nexus3 automatic installation script》, Everyone operates according to their actual situation.

2. System configuration

mac os:Monterey
mac version:12.4 (21F79)
mac type: MacBook Air (M1, 2020), Apple M1

docker desktop version:v4.10.0 
docker version:v20.10.17
docker-compose version: v1.29.2

3. Installation steps

1. Dockerhub view mirror address

# If you are lazy, you can use the last "Nexus3 automatic installation script", which is common to mac computers/r/sonatype/nexus3/tags

2. One-click installation

2.1. Cloning the script

git clone git@:xiaoyaojiugui/

2.2. Install the program

# 1. Jump to the root directory of the download script and execute the command:cd /technical/docker/foundations/server

# 2. Execute the installation script and execute the command:sh ./
2.2.1. Program installation details
---------------Function execution begins---------------
1.1、Perform the container creation operation,Skip this step,The mirror already exists[sonatype/nexus3]
1.2、Perform the container creation operation,Create a directory and authorize it,Execute the command:sudo mkdir -p -v /home//data/docker/volumes/nexus3/{nexus-data,logs} && sudo chmod -R 777 /home//data/docker/volumes/nexus3 

1.3、Perform the container creation operation,Execute the command:docker run -d -p 38081:8081 -p 38082:8082 -p 38083:8083 --platform linux/amd64 --privileged=true -e INSTALL4J_ADD_VM_PARAMS=-Xms128m -Xmx512m -XX:MaxDirectMemorySize=512m -=/nexus-data/javaprefs -v /home//data/docker/volumes/nexus3/nexus-data:/nexus-data -v /etc/timezone:/etc/timezone:ro --name nexus3 sonatype/nexus3

1.4.1、Check container status,Execute the command:docker inspect --format='{{.}}' nexus3
1.4.2、Check container status,[running]
1.4.3、View container details,Execute the command:docker ps | grep sonatype/nexus3
---------------Function execution is completed---------------

2.3. Uninstall the program

# 1. Jump to the root directory of the download script and execute the command:cd /technical/docker/foundations/server

# 2. Execute the installation script and execute the command:sh ./ delete
2.3.1. Program uninstall details
---------------Function execution begins---------------
1.1、Perform container deletion operation,Skip this step,Delete the original image[sonatype/nexus3]
1.2、Perform container deletion operation,Skip this step,Create a directory[/home//data/docker/volumes/nexus3]
1.3、Perform container deletion operation,Skip this step,The first time the container is initialized[nexus3]
1.4、Perform container deletion operation,Skip this step,Check container status
1.5.1、Perform container deletion operation,Execute the command:docker stop nexus3 && docker rm nexus3
1.5.2、Perform container deletion operation,Delete the container successfully[nexus3]
1.6.1、Perform container deletion operation,Delete folder,Execute the command:sudo rm -rf /home//data/docker/volumes/nexus3
1.6.2、Perform container deletion operation,成功Delete folder[/home//data/docker/volumes/nexus3]
---------------Function execution is completed---------------

3. Log in to Nexus3

http://localhost:38081/

4. Check admin password

docker exec -it nexus3 cat /nexus-data/

4. Postscript

After the automation script is installed, the local Nexus3 can basically be played casually. If there is any wrong with the article, please leave a message and will be corrected in time. Thank you for reading! !

This is the article about Mac deploying Nexus3 with one-click docker. For more related content related to docker deploying Nexus3 with one-click docker, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!