Difference between revisions of "Docker exec"

From wikieduonline
Jump to navigation Jump to search
Line 26: Line 26:
 
* <code>[[docker-compose exec]]</code>
 
* <code>[[docker-compose exec]]</code>
 
* [[Dsh]] [[Bash]] alias function for <code>docker exec -it CONTAINER_NAME [[bash|sh]]</code>
 
* [[Dsh]] [[Bash]] alias function for <code>docker exec -it CONTAINER_NAME [[bash|sh]]</code>
 +
* <code>[[is restarting, wait until the container is running]]</code>
  
 
== See also ==
 
== See also ==

Revision as of 11:30, 13 March 2023

https://docs.docker.com/engine/reference/commandline/exec/


  • Login/Connect into a running container:
    • docker exec[1] -it <my_container_name> bash
    • docker exec -it <my_container_name> sh
    • docker run -it --user USER_NAME CONTAINER_NAME


docker exec -it CONTAINER_NAME sh
unable to find user nginx: no matching entries in passwd file
docker exec -it festive_lewin sh
Error response from daemon: Container 2391a43638f822b1dc3e8d8c79c461959de2238c48d580c7092d5a278e5bd792 is not running
docker exec -u 0 -it CONTAINER_NAME  bash

Related commands

See also

  • https://docs.docker.com/engine/reference/commandline/exec/
  • Advertising: