DEV Community

Olaiya Stephen
Olaiya Stephen

Posted on • Updated on

Setting up Sonartype nexus on your local docker

If you installed Sonatype Nexus Repository Manager with Docker and the generated password for the admin user is stored in a file named admin.password inside a volume, you can retrieve the password by accessing the file.

Here are the steps to retrieve the admin password:

Identify the volume that contains the admin.password file. You can do this by running the docker inspect command on your Nexus container:

docker inspect | grep Source

Replace with the name of your Nexus container.

Once you have identified the volume, you can use the docker run command to start a temporary container with access to that volume:

bash

docker run --rm -v :/data alpine cat /data/admin.password

Replace with the name of the volume that contains the admin.password file.

The output of the command will be the generated password for the admin user. You can use this password to log in to the Nexus web interface and change the admin password to something more secure.

Note that the docker run command used in step 2 starts a temporary container and mounts the specified volume to the /data directory in the container. The cat command is used to read the contents of the admin.password file and output it to the terminal. Once the command has completed, the temporary container is automatically removed with the --rm option.

Top comments (0)