You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No, I'm looking for documentation on how to get a shell in a non-running container (aka an image), where the default entrypoint has been overridden (ENTRYPOINT ["/usr/local/bin/_entrypoint.sh", "anothercommand"]), such that I get the proper container environment.
After much experimenting and reading the existing dockerfile, I think this is what I need to override:
$ docker run -it --entrypoint /usr/local/bin/_entrypoint.sh <mycontainerimage> /bin/bash
Yes, if you set a new ENTRYPOINT in a derived image and then you want to get back to the old ENTRYPOINT you can specify the old ENTRYPOINT on the command line:
$ docker run -it --entrypoint /usr/local/bin/_entrypoint.sh <mycontainerimage> /bin/bash
and if you are still using the default (or root) user you can even get away with:
$ docker run -it --entrypoint /bin/bash <mycontainerimage>
As the .bashrc for that user will activate the environment.
I will think about how this would best fit into the documentation. PRs are welcome of course....
The documentation lists how to properly use
docker exec
however it doesn't list how to get a shell in an image.The text was updated successfully, but these errors were encountered: