From 3f6e861c14bf13bb5b43aacb9edfbb027d6b6903 Mon Sep 17 00:00:00 2001 From: Julien Maitrehenry Date: Tue, 25 Apr 2017 20:54:06 -0400 Subject: [PATCH] Clarify where the RUN command runs from Also, chained/quoted shell does not work Signed-off-by: Julien Maitrehenry --- docs/reference/commandline/exec.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/reference/commandline/exec.md b/docs/reference/commandline/exec.md index 1ae46cf194..e2e5d607b9 100644 --- a/docs/reference/commandline/exec.md +++ b/docs/reference/commandline/exec.md @@ -39,6 +39,14 @@ The command started using `docker exec` only runs while the container's primary process (`PID 1`) is running, and it is not restarted if the container is restarted. +COMMAND will run in the default directory of the container. It the +underlying image has a custom directory specified with the WORKDIR directive +in its Dockerfile, this will be used instead. + +COMMAND should be an executable, a chained or a quoted command +will not work. Example: `docker exec -ti my_container "echo a && echo b"` will +not work, but `docker exec -ti my_container sh -c "echo a && echo b"` will. + ## Examples ### Run `docker exec` on a running container