Editing Docker exec
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | |||
https://docs.docker.com/engine/reference/commandline/exec/ | https://docs.docker.com/engine/reference/commandline/exec/ | ||
− | |||
− | * '''Login''' | + | * '''Login/Connect''' into a running container: |
** <code>[[docker exec]]<ref>https://docs.docker.com/engine/reference/commandline/exec/</ref> -it <my_container_name> bash</code> | ** <code>[[docker exec]]<ref>https://docs.docker.com/engine/reference/commandline/exec/</ref> -it <my_container_name> bash</code> | ||
− | |||
** <code>docker exec -it <my_container_name> sh</code> | ** <code>docker exec -it <my_container_name> sh</code> | ||
** <code>[[docker run]] -it --user USER_NAME CONTAINER_NAME</code> | ** <code>[[docker run]] -it --user USER_NAME CONTAINER_NAME</code> | ||
Line 13: | Line 10: | ||
docker exec -it CONTAINER_NAME sh | docker exec -it CONTAINER_NAME sh | ||
unable to find user nginx: no matching entries in passwd file | unable to find user nginx: no matching entries in passwd file | ||
− | |||
− | |||
− | |||
docker exec -u 0 -it CONTAINER_NAME bash | docker exec -u 0 -it CONTAINER_NAME bash | ||
− | + | == Related commands == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == Related == | ||
* <code>[[kubectl exec]]</code> | * <code>[[kubectl exec]]</code> | ||
− | |||
− | |||
* <code>[[docker system events]] --since '240m' | grep bash</code> | * <code>[[docker system events]] --since '240m' | grep bash</code> | ||
* <code>[[podman attach]]</code> | * <code>[[podman attach]]</code> | ||
Line 35: | Line 20: | ||
* <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> | ||
− | |||
− | |||
− | |||
== See also == | == See also == | ||
− | * {{docker | + | * {{docker}} |
− | |||
− | |||
[[Category:Docker]] | [[Category:Docker]] |
Advertising: