| ... | ... |
@@ -16,7 +16,7 @@ out every second. It will continue to do this until we stop it. |
| 16 | 16 |
|
| 17 | 17 |
.. code-block:: bash |
| 18 | 18 |
|
| 19 |
- $ CONTAINER_ID=$(docker run -d base /bin/sh -c "while true; do echo hello world; sleep 1; done") |
|
| 19 |
+ CONTAINER_ID=$(docker run -d base /bin/sh -c "while true; do echo hello world; sleep 1; done") |
|
| 20 | 20 |
|
| 21 | 21 |
We are going to run a simple hello world daemon in a new container made from the busybox daemon. |
| 22 | 22 |
|
| ... | ... |
@@ -28,7 +28,7 @@ We are going to run a simple hello world daemon in a new container made from the |
| 28 | 28 |
|
| 29 | 29 |
.. code-block:: bash |
| 30 | 30 |
|
| 31 |
- $ docker logs $CONTAINER_ID |
|
| 31 |
+ docker logs $CONTAINER_ID |
|
| 32 | 32 |
|
| 33 | 33 |
Check the logs make sure it is working correctly. |
| 34 | 34 |
|
| ... | ... |
@@ -54,7 +54,7 @@ Check the process list to make sure it is running. |
| 54 | 54 |
|
| 55 | 55 |
.. code-block:: bash |
| 56 | 56 |
|
| 57 |
- $ docker stop $CONTAINER_ID |
|
| 57 |
+ docker stop $CONTAINER_ID |
|
| 58 | 58 |
|
| 59 | 59 |
Stop the container, since we don't need it anymore. |
| 60 | 60 |
|
| ... | ... |
@@ -12,44 +12,44 @@ The goal of this example is to show you how you can author your own docker image |
| 12 | 12 |
|
| 13 | 13 |
.. code-block:: bash |
| 14 | 14 |
|
| 15 |
- $ docker pull shykes/pybuilder |
|
| 15 |
+ docker pull shykes/pybuilder |
|
| 16 | 16 |
|
| 17 | 17 |
We are downloading the "shykes/pybuilder" docker image |
| 18 | 18 |
|
| 19 | 19 |
.. code-block:: bash |
| 20 | 20 |
|
| 21 |
- $ URL=http://github.com/shykes/helloflask/archive/master.tar.gz |
|
| 21 |
+ URL=http://github.com/shykes/helloflask/archive/master.tar.gz |
|
| 22 | 22 |
|
| 23 | 23 |
We set a URL variable that points to a tarball of a simple helloflask web app |
| 24 | 24 |
|
| 25 | 25 |
.. code-block:: bash |
| 26 | 26 |
|
| 27 |
- $ BUILD_JOB=$(docker run -t shykes/pybuilder:1d9aab3737242c65 /usr/local/bin/buildapp $URL) |
|
| 27 |
+ BUILD_JOB=$(docker run -t shykes/pybuilder:1d9aab3737242c65 /usr/local/bin/buildapp $URL) |
|
| 28 | 28 |
|
| 29 | 29 |
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'. |
| 30 | 30 |
|
| 31 | 31 |
.. code-block:: bash |
| 32 | 32 |
|
| 33 |
- $ docker attach $BUILD_JOB |
|
| 33 |
+ docker attach $BUILD_JOB |
|
| 34 | 34 |
[...] |
| 35 | 35 |
|
| 36 | 36 |
We attach to the new container to see what is going on. Ctrl-C to disconnect |
| 37 | 37 |
|
| 38 | 38 |
.. code-block:: bash |
| 39 | 39 |
|
| 40 |
- $ BUILD_IMG=$(docker commit $BUILD_JOB _/builds/github.com/hykes/helloflask/master) |
|
| 40 |
+ BUILD_IMG=$(docker commit $BUILD_JOB _/builds/github.com/hykes/helloflask/master) |
|
| 41 | 41 |
|
| 42 | 42 |
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. |
| 43 | 43 |
|
| 44 | 44 |
.. code-block:: bash |
| 45 | 45 |
|
| 46 |
- $ WEB_WORKER=$(docker run -p 5000 $BUILD_IMG /usr/local/bin/runapp) |
|
| 46 |
+ WEB_WORKER=$(docker run -p 5000 $BUILD_IMG /usr/local/bin/runapp) |
|
| 47 | 47 |
|
| 48 | 48 |
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. |
| 49 | 49 |
|
| 50 | 50 |
.. code-block:: bash |
| 51 | 51 |
|
| 52 |
- $ docker logs $WEB_WORKER |
|
| 52 |
+ docker logs $WEB_WORKER |
|
| 53 | 53 |
* Running on http://0.0.0.0:5000/ |
| 54 | 54 |
|
| 55 | 55 |
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 @@ |
| 13 | 13 |
<meta name="viewport" content="width=device-width"> |
| 14 | 14 |
|
| 15 | 15 |
<!-- twitter bootstrap --> |
| 16 |
- <link rel="stylesheet" href="../_static/css/bootstrap.min.css"> |
|
| 17 |
- <link rel="stylesheet" href="../_static/css/bootstrap-responsive.min.css"> |
|
| 16 |
+ <link rel="stylesheet" href="_static/css/bootstrap.min.css"> |
|
| 17 |
+ <link rel="stylesheet" href="_static/css/bootstrap-responsive.min.css"> |
|
| 18 | 18 |
|
| 19 | 19 |
<!-- main style file --> |
| 20 |
- <link rel="stylesheet" href="../_static/css/main.css"> |
|
| 20 |
+ <link rel="stylesheet" href="_static/css/main.css"> |
|
| 21 | 21 |
|
| 22 | 22 |
<!-- vendor scripts --> |
| 23 |
- <script src="../_static/js/vendor/jquery-1.9.1.min.js" type="text/javascript" ></script> |
|
| 24 |
- <script src="../_static/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js" type="text/javascript" ></script> |
|
| 23 |
+ <script src="_static/js/vendor/jquery-1.9.1.min.js" type="text/javascript" ></script> |
|
| 24 |
+ <script src="_static/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js" type="text/javascript" ></script> |
|
| 25 | 25 |
|
| 26 | 26 |
</head> |
| 27 | 27 |
|