浏览代码

Merge pull request #5564 from felixrabe/patch-4

cli.md: sudo at the right place
O.S. Tezer 11 年之前
父节点
当前提交
d0c97d5bd2
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      docs/sources/reference/commandline/cli.md

+ 2 - 2
docs/sources/reference/commandline/cli.md

@@ -994,7 +994,7 @@ the same mode (read write or read only) as the reference container.
 The `-a` flag tells `docker run` to bind to the container's stdin, stdout or
 The `-a` flag tells `docker run` to bind to the container's stdin, stdout or
 stderr. This makes it possible to manipulate the output and input as needed.
 stderr. This makes it possible to manipulate the output and input as needed.
 
 
-    $ sudo echo "test" | docker run -i -a stdin ubuntu cat -
+    $ echo "test" | sudo docker run -i -a stdin ubuntu cat -
 
 
 This pipes data into a container and prints the container's ID by attaching
 This pipes data into a container and prints the container's ID by attaching
 only to the container'sstdin.
 only to the container'sstdin.
@@ -1005,7 +1005,7 @@ This isn't going to print anything unless there's an error because We've
 only attached to the stderr of the container. The container's logs still
 only attached to the stderr of the container. The container's logs still
    store what's been written to stderr and stdout.
    store what's been written to stderr and stdout.
 
 
-    $ sudo cat somefile | docker run -i -a stdin mybuilder dobuild
+    $ cat somefile | sudo docker run -i -a stdin mybuilder dobuild
 
 
 This is how piping a file into a container could be done for a build.
 This is how piping a file into a container could be done for a build.
 The container's ID will be printed after the build is done and the build
 The container's ID will be printed after the build is done and the build