Prechádzať zdrojové kódy

Fixed broken examples in docs

Solomon Hykes 12 rokov pred
rodič
commit
4a086dfc08

+ 3 - 3
docs/sources/documentation/commandline/basecommands.rst

@@ -26,10 +26,10 @@ Starting a long-running worker process
 .. code-block:: bash
 .. code-block:: bash
 
 
   # Run docker in daemon mode
   # Run docker in daemon mode
-  (docker -d || echo "Docker daemon already running") &
+  (sudo docker -d || echo "Docker daemon already running") &
 
 
   # Start a very useful long-running process
   # Start a very useful long-running process
-  JOB=$(docker run base /bin/sh -c "while true; do echo Hello world!; sleep 1; done")
+  JOB=$(docker run -d base /bin/sh -c "while true; do echo Hello world; sleep 1; done")
 
 
   # Collect the output of the job so far
   # Collect the output of the job so far
   docker logs $JOB
   docker logs $JOB
@@ -51,7 +51,7 @@ Expose a service on a TCP port
 .. code-block:: bash
 .. code-block:: bash
 
 
   # Expose port 4444 of this container, and tell netcat to listen on it
   # Expose port 4444 of this container, and tell netcat to listen on it
-  JOB=$(docker run -p 4444 base /bin/nc -l -p 4444)
+  JOB=$(docker run -d -p 4444 base /bin/nc -l -p 4444)
 
 
   # Which public port is NATed to my container?
   # Which public port is NATed to my container?
   PORT=$(docker port $JOB 4444)
   PORT=$(docker port $JOB 4444)