mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Removed $'s from examples to make them easier to copy paste
This commit is contained in:
		
							parent
							
								
									172f746e4d
								
							
						
					
					
						commit
						9bc7e71f16
					
				
					 3 changed files with 15 additions and 15 deletions
				
			
		| 
						 | 
				
			
			@ -16,7 +16,7 @@ out every second. It will continue to do this until we stop it.
 | 
			
		|||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
    $ CONTAINER_ID=$(docker run -d base /bin/sh -c "while true; do echo hello world; sleep 1; done")
 | 
			
		||||
    CONTAINER_ID=$(docker run -d base /bin/sh -c "while true; do echo hello world; sleep 1; done")
 | 
			
		||||
 | 
			
		||||
We are going to run a simple hello world daemon in a new container made from the busybox daemon.
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -28,7 +28,7 @@ We are going to run a simple hello world daemon in a new container made from the
 | 
			
		|||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
    $ docker logs $CONTAINER_ID
 | 
			
		||||
    docker logs $CONTAINER_ID
 | 
			
		||||
 | 
			
		||||
Check the logs make sure it is working correctly.
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -54,7 +54,7 @@ Check the process list to make sure it is running.
 | 
			
		|||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
    $ docker stop $CONTAINER_ID
 | 
			
		||||
    docker stop $CONTAINER_ID
 | 
			
		||||
 | 
			
		||||
Stop the container, since we don't need it anymore.
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,44 +12,44 @@ The goal of this example is to show you how you can author your own docker image
 | 
			
		|||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
    $ docker pull shykes/pybuilder
 | 
			
		||||
    docker pull shykes/pybuilder
 | 
			
		||||
 | 
			
		||||
We are downloading the "shykes/pybuilder" docker image
 | 
			
		||||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
    $ URL=http://github.com/shykes/helloflask/archive/master.tar.gz
 | 
			
		||||
    URL=http://github.com/shykes/helloflask/archive/master.tar.gz
 | 
			
		||||
 | 
			
		||||
We set a URL variable that points to a tarball of a simple helloflask web app
 | 
			
		||||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
    $ BUILD_JOB=$(docker run -t shykes/pybuilder:1d9aab3737242c65 /usr/local/bin/buildapp $URL)
 | 
			
		||||
    BUILD_JOB=$(docker run -t shykes/pybuilder:1d9aab3737242c65 /usr/local/bin/buildapp $URL)
 | 
			
		||||
 | 
			
		||||
Inside of the "shykes/pybuilder" image there is a command called buildapp, we are running that command and passing the $URL variable from step 2 to it, and running the whole thing inside of a new container. BUILD_JOB will be set with the new container_id. "1d9aab3737242c65" came from the output of step 1 when importing image. also available from 'docker images'.
 | 
			
		||||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
    $ docker attach $BUILD_JOB
 | 
			
		||||
    docker attach $BUILD_JOB
 | 
			
		||||
    [...]
 | 
			
		||||
 | 
			
		||||
We attach to the new container to see what is going on. Ctrl-C to disconnect
 | 
			
		||||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
    $ BUILD_IMG=$(docker commit $BUILD_JOB _/builds/github.com/hykes/helloflask/master)
 | 
			
		||||
    BUILD_IMG=$(docker commit $BUILD_JOB _/builds/github.com/hykes/helloflask/master)
 | 
			
		||||
 | 
			
		||||
Save the changed we just made in the container to a new image called "_/builds/github.com/hykes/helloflask/master" and save the image id in the BUILD_IMG variable name.
 | 
			
		||||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
    $ WEB_WORKER=$(docker run -p 5000 $BUILD_IMG /usr/local/bin/runapp)
 | 
			
		||||
    WEB_WORKER=$(docker run -p 5000 $BUILD_IMG /usr/local/bin/runapp)
 | 
			
		||||
 | 
			
		||||
Use the new image we just created and create a new container with network port 5000, and return the container id and store in the WEB_WORKER variable.
 | 
			
		||||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
    $ docker logs $WEB_WORKER
 | 
			
		||||
    docker logs $WEB_WORKER
 | 
			
		||||
     * Running on http://0.0.0.0:5000/
 | 
			
		||||
 | 
			
		||||
view the logs for the new container using the WEB_WORKER variable, and if everything worked as planned you should see the line "Running on http://0.0.0.0:5000/" in the log output.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,15 +13,15 @@
 | 
			
		|||
    <meta name="viewport" content="width=device-width">
 | 
			
		||||
 | 
			
		||||
    <!-- twitter bootstrap -->
 | 
			
		||||
    <link rel="stylesheet" href="../_static/css/bootstrap.min.css">
 | 
			
		||||
    <link rel="stylesheet" href="../_static/css/bootstrap-responsive.min.css">
 | 
			
		||||
    <link rel="stylesheet" href="_static/css/bootstrap.min.css">
 | 
			
		||||
    <link rel="stylesheet" href="_static/css/bootstrap-responsive.min.css">
 | 
			
		||||
 | 
			
		||||
    <!-- main style file -->
 | 
			
		||||
    <link rel="stylesheet" href="../_static/css/main.css">
 | 
			
		||||
    <link rel="stylesheet" href="_static/css/main.css">
 | 
			
		||||
 | 
			
		||||
    <!-- vendor scripts -->
 | 
			
		||||
    <script src="../_static/js/vendor/jquery-1.9.1.min.js" type="text/javascript" ></script>
 | 
			
		||||
    <script src="../_static/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js" type="text/javascript" ></script>
 | 
			
		||||
    <script src="_static/js/vendor/jquery-1.9.1.min.js" type="text/javascript" ></script>
 | 
			
		||||
    <script src="_static/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js" type="text/javascript" ></script>
 | 
			
		||||
 | 
			
		||||
</head>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue