Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Below are some extra tips and commands that might come in handy. 

 

Code Block
languagebash
themeMidnight
titleExecuting a command in a currently running container

...

collapsetrue
docker exec <container name> <command arguments>


We ran into this command when accessing 
jupyter in the section above. The exec command allows you to execute arbitrary commands in a running container, e.g. a python script.

 

 

 

Code Block
languagebash
themeMidnight
titleExecuting Getting a command shell in a currently running container
collapsetrue
docker exec -it <container name> <command arguments>bash

 

 

This returns a shell that gives you terminal level access to your container. It might be highly useful when setting up things in a container that was not already fixed by the docker script, or for just getting more familiar with the environment you’ve created. Note the –it switches used; they make the session interactive, which means that stdin from your current shell will be hooked up to the shell granted by the container. 




 

 

Info

Feel free to help us provide a better wiki by sharing your skills and knowledge.

...