瀏覽代碼

Merge pull request #32831 from jmaitrehenry/patch-2

Clarify where the RUN command runs from
Misty Stanley-Jones 8 年之前
父節點
當前提交
94465adaf0
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      docs/reference/commandline/exec.md

+ 8 - 0
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