'Base' is depreciated and should no longer be referenced in the docs.

https://groups.google.com/forum/\#!topic/docker-club/pEjqMgcrnqA
This commit is contained in:
Daniel Nordberg
2013-08-05 01:34:32 +03:00
parent 4dcc0f316c
commit 51d0c9238b
6 changed files with 46 additions and 46 deletions
+3 -3
View File
@@ -15,8 +15,8 @@ Download the base container
.. code-block:: bash
# Download a base image
docker pull base
# Download an ubuntu image
docker pull ubuntu
The *base* image is a minimal *ubuntu* based container, alternatively you can select *busybox*, a bare
minimal linux system. The images are retrieved from the docker repository.
@@ -47,4 +47,4 @@ See the example in action
</div>
Continue to the :ref:`hello_world_daemon` example.
Continue to the :ref:`hello_world_daemon` example.
+5 -5
View File
@@ -11,20 +11,20 @@ Hello World Daemon
The most boring daemon ever written.
This example assumes you have Docker installed and with the base image already imported ``docker pull base``.
We will use the base image to run a simple hello world daemon that will just print hello world to standard
This example assumes you have Docker installed and with the ubuntu image already imported ``docker pull ubuntu``.
We will use the ubuntu image to run a simple hello world daemon that will just print hello world to standard
out every second. It will continue to do this until we stop it.
**Steps:**
.. 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 ubuntu /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 base image.
We are going to run a simple hello world daemon in a new container made from the ubuntu image.
- **"docker run -d "** run a command in a new container. We pass "-d" so it runs as a daemon.
- **"base"** is the image we want to run the command inside of.
- **"ubuntu"** is the image we want to run the command inside of.
- **"/bin/sh -c"** is the command we want to run in the container
- **"while true; do echo hello world; sleep 1; done"** is the mini script we want to run, that will just print hello world once a second until we stop it.
- **$CONTAINER_ID** the output of the run command will return a container id, we can use in future commands to see what is going on with this process.
@@ -34,12 +34,12 @@ The password is 'screencast'
.. code-block:: bash
# Hello! We are going to try and install openssh on a container and run it as a servic
# let's pull base to get a base ubuntu image.
$ docker pull base
# let's pull ubuntu to get a base ubuntu image.
$ docker pull ubuntu
# I had it so it was quick
# now let's connect using -i for interactive and with -t for terminal
# we execute /bin/bash to get a prompt.
$ docker run -i -t base /bin/bash
$ docker run -i -t ubuntu /bin/bash
# now let's commit it
# which container was it?
$ docker ps -a |more
+11 -11
View File
@@ -26,12 +26,12 @@ Running an interactive shell
.. code-block:: bash
# Download a base image
docker pull base
# Download an ubuntu image
docker pull ubuntu
# Run an interactive shell in the base image,
# Run an interactive shell in the ubuntu image,
# allocate a tty, attach stdin and stdout
docker run -i -t base /bin/bash
docker run -i -t ubuntu /bin/bash
Bind Docker to another host/port or a unix socket
-------------------------------------------------
@@ -52,8 +52,8 @@ For example:
# Run docker in daemon mode
sudo <path to>/docker -H 0.0.0.0:5555 -d &
# Download a base image
docker -H :5555 pull base
# Download an ubuntu image
docker -H :5555 pull ubuntu
You can use multiple -H, for example, if you want to listen
on both tcp and a unix socket
@@ -62,10 +62,10 @@ on both tcp and a unix socket
# Run docker in daemon mode
sudo <path to>/docker -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock -d &
# Download a base image
docker pull base
# Download an ubuntu image
docker pull ubuntu
# OR
docker -H unix:///var/run/docker.sock pull base
docker -H unix:///var/run/docker.sock pull ubuntu
Starting a long-running worker process
--------------------------------------
@@ -73,7 +73,7 @@ Starting a long-running worker process
.. code-block:: bash
# Start a very useful long-running process
JOB=$(docker run -d base /bin/sh -c "while true; do echo Hello world; sleep 1; done")
JOB=$(docker run -d ubuntu /bin/sh -c "while true; do echo Hello world; sleep 1; done")
# Collect the output of the job so far
docker logs $JOB
@@ -95,7 +95,7 @@ Expose a service on a TCP port
.. code-block:: bash
# Expose port 4444 of this container, and tell netcat to listen on it
JOB=$(docker run -d -p 4444 base /bin/nc -l -p 4444)
JOB=$(docker run -d -p 4444 ubuntu /bin/nc -l -p 4444)
# Which public port is NATed to my container?
PORT=$(docker port $JOB 4444)
+6 -6
View File
@@ -53,13 +53,13 @@ defined type which can be used like so:
.. code-block:: ruby
docker::image { 'base': }
docker::image { 'ubuntu': }
This is equivalent to running:
.. code-block:: bash
docker pull base
docker pull ubuntu
Note that it will only if the image of that name does not already exist.
This is downloading a large binary so on first run can take a while.
@@ -68,7 +68,7 @@ for exec. Note that you can also remove images you no longer need with:
.. code-block:: ruby
docker::image { 'base':
docker::image { 'ubuntu':
ensure => 'absent',
}
@@ -81,7 +81,7 @@ docker.
.. code-block:: ruby
docker::run { 'helloworld':
image => 'base',
image => 'ubuntu',
command => '/bin/sh -c "while true; do echo hello world; sleep 1; done"',
}
@@ -89,14 +89,14 @@ This is equivalent to running the following command, but under upstart:
.. code-block:: bash
docker run -d base /bin/sh -c "while true; do echo hello world; sleep 1; done"
docker run -d ubuntu /bin/sh -c "while true; do echo hello world; sleep 1; done"
Run also contains a number of optional parameters:
.. code-block:: ruby
docker::run { 'helloworld':
image => 'base',
image => 'ubuntu',
command => '/bin/sh -c "while true; do echo hello world; sleep 1; done"',
ports => ['4444', '4555'],
volumes => ['/var/lib/counchdb', '/var/log'],