Add docs for printing the generated admin.password#116
Add docs for printing the generated admin.password#116ahmed-musallam wants to merge 3 commits intosonatype:mainfrom
Conversation
| > 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` |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
@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 ?
There was a problem hiding this comment.
@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
There was a problem hiding this comment.
@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!
There was a problem hiding this comment.
@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!
There was a problem hiding this comment.
@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.
| > 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` |
There was a problem hiding this comment.
@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
Add simple documentation for printing the generted admin.password
This pull request makes the following changes: