Difference between revisions of "Docker exec"

From wikieduonline
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 23: Line 23:
 
  docker exec [[CONTAINER_NAME]] [[printenv]]
 
  docker exec [[CONTAINER_NAME]] [[printenv]]
  
== Related commands ==
+
== Activities ==
 +
* [[Connect into a running container]]
 +
 
 +
== Related ==
 
* <code>[[kubectl exec]]</code>
 
* <code>[[kubectl exec]]</code>
 
* <code>[[podman exec]]</code>
 
* <code>[[podman exec]]</code>
Line 37: Line 40:
  
 
== See also ==
 
== See also ==
 +
* {{docker exec}}
 
* {{docker cmd}}
 
* {{docker cmd}}
* {{docker}}
+
 
  
  
 
[[Category:Docker]]
 
[[Category:Docker]]

Latest revision as of 09:55, 21 March 2024

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

docker exec -it my_container sh -c "echo a && echo b"


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

Show Environment variables[edit]

docker exec CONTAINER_NAME env
docker exec CONTAINER_NAME printenv

Activities[edit]

Related[edit]

See also[edit]

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