Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for printing the generated admin.password #116

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ahmed-musallam
Copy link

Add simple documentation for printing the generted admin.password

This pull request makes the following changes:

  • Documentation changes in README.md

README.md Outdated
> A simple way to print the password is the follwoing:
> - After the nexus3 contaier is finished running, run `docker ps --filter "ancestor=sonatype/nexus3"`
> it will print a list of containers, find your container and copy the `CONTAINER ID`
> - Run `docker container exec -it <CONTAINER ID> cat /nexus-data/admin.password && echo`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason that the previous command is not combined with this one? I don't have a test environment handy, but I'm imagining something like:
docker container exec -it $(docker ps --filter "ancestor=sonatype/nexus3" | awk '{print $1}') cat /nexus-data/admin.password && echo

Copy link
Author

@ahmed-musallam ahmed-musallam Mar 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wwannemacher The main reason is if a user is running multiple containers based on the same image. But I do not mind combining the commands :)
The goal is for users to get this generated password easily.

What would be perfect: Allow users to supply a param with the docker run command like: docker run <> -e SHOW_ADMIN_PASSWORD=true (naming things is hard), and the container would print the admin password in the logs. Is that something I can contribute and you think would be beneficial ?

Copy link
Member

@collinpeters collinpeters Mar 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wwannemacher Seems reasonable. Unlikely that folks have more than one running I would assume. Though note the default output has the column headers so I suggest to use -q to just get the container id. Another suggestion is to just use the container name.
docker container exec -it $(docker ps -q --filter "name=nexus3") cat /nexus-data/admin.password && echo

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahmed-musallam - this is something that should happen at the operational level, not the application level. What you have here is good. Thanks for the contribution!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahmed-musallam FWIW, I'm totally stealing your approach for printing the generated admin password and adding it to the NXRM format archetype docs. Nice!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@collinpeters and @wwannemacher updated to use the suggested command, changed name to "nexus" though; because that's the name you use at the top of this doc.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated
> A simple way to print the password is the follwoing:
> - After the nexus3 contaier is finished running, run `docker ps --filter "ancestor=sonatype/nexus3"`
> it will print a list of containers, find your container and copy the `CONTAINER ID`
> - Run `docker container exec -it <CONTAINER ID> cat /nexus-data/admin.password && echo`
Copy link
Member

@collinpeters collinpeters Mar 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wwannemacher Seems reasonable. Unlikely that folks have more than one running I would assume. Though note the default output has the column headers so I suggest to use -q to just get the container id. Another suggestion is to just use the container name.
docker container exec -it $(docker ps -q --filter "name=nexus3") cat /nexus-data/admin.password && echo

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Member

@collinpeters collinpeters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants