Merge pull request #20754 from lyndaoleary/docker-terminology

Changed Docker references to Docker Engine in docs
This commit is contained in:
Vincent Demeester 2016-03-01 05:30:45 +01:00
commit 89f6d3b041
4 changed files with 102 additions and 118 deletions

View File

@ -11,10 +11,6 @@ weight="-90"
# Mac OS X # Mac OS X
> **Note**: This release of Docker deprecates the Boot2Docker command line in
> favor of Docker Machine. Use the Docker Toolbox to install Docker Machine as
> well as the other Docker tools.
You install Docker using Docker Toolbox. Docker Toolbox includes the following Docker tools: You install Docker using Docker Toolbox. Docker Toolbox includes the following Docker tools:
* Docker Machine for running the `docker-machine` binary * Docker Machine for running the `docker-machine` binary
@ -67,7 +63,7 @@ installer.
1. Go to the [Docker Toolbox](https://www.docker.com/toolbox) page. 1. Go to the [Docker Toolbox](https://www.docker.com/toolbox) page.
2. Click the installer link to download. 2. Click the Download link.
3. Install Docker Toolbox by double-clicking the package or by right-clicking 3. Install Docker Toolbox by double-clicking the package or by right-clicking
and choosing "Open" from the pop-up menu. and choosing "Open" from the pop-up menu.
@ -89,7 +85,7 @@ and choosing "Open" from the pop-up menu.
* makes these binaries available to all users * makes these binaries available to all users
* installs VirtualBox; or updates any existing installation * installs VirtualBox; or updates any existing installation
Change these defaults by pressing "Customize" or "Change To change these defaults, press "Customize" or "Change
Install Location." Install Location."
5. Press "Install" to perform the standard installation. 5. Press "Install" to perform the standard installation.
@ -107,16 +103,15 @@ and choosing "Open" from the pop-up menu.
7. Press "Close" to exit. 7. Press "Close" to exit.
## Running a Docker Container ## Running a Docker Container
To run a Docker container, you: To run a Docker container, you:
* create a new (or start an existing) virtual machine that runs Docker. * Create a new (or start an existing) virtual machine
* switch your environment to your new VM * Switch your environment to your new VM
* use the `docker` client to create, load, and manage containers * Use the `docker` client to create, load, and manage containers
Once you create a machine, you can reuse it as often as you like. Like any You can reuse this virtual machine as often as you like. Like any
VirtualBox VM, it maintains its configuration between uses. VirtualBox VM, it maintains its configuration between uses.
There are two ways to use the installed tools, from the Docker Quickstart Terminal or There are two ways to use the installed tools, from the Docker Quickstart Terminal or
@ -130,9 +125,9 @@ There are two ways to use the installed tools, from the Docker Quickstart Termin
The application: The application:
* opens a terminal window * Opens a terminal window
* creates a `default` VM if it doesn't exists, and starts the VM after * Creates a `default` VM if it doesn't exists, and starts the VM after
* points the terminal environment to this VM * Points the terminal environment to this VM
Once the launch completes, the Docker Quickstart Terminal reports: Once the launch completes, the Docker Quickstart Terminal reports:
@ -222,7 +217,6 @@ different shell such as C Shell but the commands are the same.
$ docker run hello-world $ docker run hello-world
## Learn about your Toolbox installation ## Learn about your Toolbox installation
Toolbox installs the Docker Engine binary, the Docker binary on your system. When you Toolbox installs the Docker Engine binary, the Docker binary on your system. When you
@ -271,7 +265,7 @@ and what it does:
| upgrade | upgrade | Upgrades a machine's Docker client to the latest stable release. | | upgrade | upgrade | Upgrades a machine's Docker client to the latest stable release. |
## Example of Docker on Mac OS X ## Examples on Mac OS X
Work through this section to try some practical container tasks on a VM. At this Work through this section to try some practical container tasks on a VM. At this
point, you should have a VM running and be connected to it through your shell. point, you should have a VM running and be connected to it through your shell.
@ -361,7 +355,7 @@ The next exercise demonstrates how to do this.
$ docker run -d -P -v $HOME/site:/usr/share/nginx/html \ $ docker run -d -P -v $HOME/site:/usr/share/nginx/html \
--name mysite nginx --name mysite nginx
6. Get the `mysite` container's port. 6. View the `mysite` container's port.
$ docker port mysite $ docker port mysite
80/tcp -> 0.0.0.0:49166 80/tcp -> 0.0.0.0:49166
@ -371,7 +365,7 @@ The next exercise demonstrates how to do this.
![My site page](images/newsite_view.png) ![My site page](images/newsite_view.png)
8. Try adding a page to your `$HOME/site` in real time. 8. Add a page to your `$HOME/site` in real time.
$ echo "This is cool" > cool.html $ echo "This is cool" > cool.html
@ -391,7 +385,7 @@ The next exercise demonstrates how to do this.
## Upgrade Docker Toolbox ## Upgrade Docker Toolbox
To upgrade Docker Toolbox, download and re-run [the Docker Toolbox To upgrade Docker Toolbox, download and re-run the [Docker Toolbox
installer](https://docker.com/toolbox/). installer](https://docker.com/toolbox/).
@ -427,9 +421,9 @@ To uninstall, do the following:
## Learning more ## Learning more
Use `docker-machine help` to list the full command line reference for Docker Machine. For more Use `docker-machine help` to list the full command line reference for Docker Machine. For more
information about using SSH or SCP to access a VM, see [the Docker Machine information about using SSH or SCP to access a VM, see the [Docker Machine
documentation](https://docs.docker.com/machine/). documentation](https://docs.docker.com/machine/).
You can continue with the [Docker User Guide](../userguide/index.md). If you are You can continue with the [Docker Engine User Guide](../userguide/index.md). If you are
interested in using the Kitematic GUI, see the [Kitematic user interested in using the Kitematic GUI, see the [Kitematic user
guide](https://docs.docker.com/kitematic/userguide/). guide](https://docs.docker.com/kitematic/userguide/).

View File

@ -144,9 +144,9 @@ installer.
To run a Docker container, you: To run a Docker container, you:
* create a new (or start an existing) Docker virtual machine * Create a new (or start an existing) Docker virtual machine
* switch your environment to your new VM * Switch your environment to your new VM
* use the `docker` client to create, load, and manage containers * Use the `docker` client to create, load, and manage containers
Once you create a machine, you can reuse it as often as you like. Like any Once you create a machine, you can reuse it as often as you like. Like any
VirtualBox VM, it maintains its configuration between uses. VirtualBox VM, it maintains its configuration between uses.
@ -160,9 +160,9 @@ There are several ways to use the installed tools, from the Docker Quickstart Te
The application: The application:
* opens a terminal window * Opens a terminal window
* creates a `default` VM if it doesn't exist, and starts the VM after * Creates a `default` VM if it doesn't exist, and starts the VM after
* points the terminal environment to this VM * Points the terminal environment to this VM
Once the launch completes, you can run `docker` commands. Once the launch completes, you can run `docker` commands.
@ -374,6 +374,6 @@ delete that file yourself.
## Learn more ## Learn more
You can continue with the [Docker User Guide](../userguide/index.md). If you are You can continue with the [Docker Engine User Guide](../userguide/index.md). If you are
interested in using the Kitematic GUI, see the [Kitematic user interested in using the Kitematic GUI, see the [Kitematic user
guide](https://docs.docker.com/kitematic/userguide/). guide](https://docs.docker.com/kitematic/userguide/).

View File

@ -1,7 +1,7 @@
<!--[metadata]> <!--[metadata]>
+++ +++
aliases = ["/engine/userguide/basics/"] aliases = ["/engine/userguide/basics/"]
title = "Quickstart containers" title = "Quickstart"
description = "Common usage and commands" description = "Common usage and commands"
keywords = ["Examples, Usage, basic commands, docker, documentation, examples"] keywords = ["Examples, Usage, basic commands, docker, documentation, examples"]
[menu.main] [menu.main]
@ -10,14 +10,14 @@ weight=-90
+++ +++
<![end-metadata]--> <![end-metadata]-->
# Quickstart Docker Engine # Docker Engine Quickstart
This quickstart assumes you have a working installation of Docker Engine. To verify Engine is installed, use the following command: This quickstart assumes you have a working installation of Docker Engine. To verify Engine is installed and configured, use the following command:
# Check that you have a working install # Check that you have a working install
$ docker info $ docker info
If you get `docker: command not found` or something like If you have a successful install, the system information appears. If you get `docker: command not found` or something like
`/var/lib/docker/repositories: permission denied` you may have an `/var/lib/docker/repositories: permission denied` you may have an
incomplete Docker installation or insufficient privileges to access incomplete Docker installation or insufficient privileges to access
Engine on your machine. With the default installation of Engine `docker` Engine on your machine. With the default installation of Engine `docker`
@ -25,9 +25,9 @@ commands need to be run by a user that is in the `docker` group or by the
`root` user. `root` user.
Depending on your Engine system configuration, you may be required Depending on your Engine system configuration, you may be required
to preface each `docker` command with `sudo`. One way to avoid having to use to preface each `docker` command with `sudo`. If you want to run without using
`sudo` with the `docker` commands is to create a Unix group called `docker` and `sudo` with the `docker` commands, then create a Unix group called `docker` and
add users that will be entering `docker` commands to the 'docker' group. add the user to the 'docker' group.
For more information about installing Docker Engine or `sudo` configuration, refer to For more information about installing Docker Engine or `sudo` configuration, refer to
the [installation](installation/index.md) instructions for your operating system. the [installation](installation/index.md) instructions for your operating system.
@ -35,34 +35,40 @@ the [installation](installation/index.md) instructions for your operating system
## Download a pre-built image ## Download a pre-built image
To pull an `ubuntu` image, run:
# Download an ubuntu image # Download an ubuntu image
$ docker pull ubuntu $ docker pull ubuntu
This will find the `ubuntu` image by name on This downloads the `ubuntu` image by name from [Docker Hub](https://hub.docker.com) to a local
[*Docker Hub*](userguide/containers/dockerrepos.md#searching-for-images) image cache. To search for an image, run `docker search`. For more information, go to:
and download it from [Docker Hub](https://hub.docker.com) to a local [Searching images](userguide/containers/dockerrepos.md#searching-for-images)
image cache.
> **Note**: > **Note**:
> When the image is successfully downloaded, you see a 12 character > When the image is successfully downloaded, you see a 12 character
> hash `539c0211cd76: Download complete` which is the > hash `539c0211cd76: Download complete` which is the
> short form of the image ID. These short image IDs are the first 12 > short form of the Image ID. These short Image IDs are the first 12
> characters of the full image ID - which can be found using > characters of the full Image ID. To view this information, run
> `docker inspect` or `docker images --no-trunc=true`. > `docker inspect` or `docker images --no-trunc=true`.
To display a list of downloaded images, run `docker images`.
## Running an interactive shell ## Running an interactive shell
To run an interactive shell in the Ubuntu image: To run an interactive shell in the Ubuntu image:
$ docker run -i -t ubuntu /bin/bash $ docker run -i -t ubuntu /bin/bash
The `-i` flag starts an interactive container. The `-t` flag creates a The `-i` flag starts an interactive container.
pseudo-TTY that attaches `stdin` and `stdout`. The `-t` flag creates a pseudo-TTY that attaches `stdin` and `stdout`.
The image is `ubuntu`.
The command `/bin/bash` starts a shell you can log in.
To detach the `tty` without exiting the shell, use the escape sequence To detach the `tty` without exiting the shell, use the escape sequence
`Ctrl-p` + `Ctrl-q`. The container will continue to exist in a stopped state `Ctrl-p` + `Ctrl-q`. The container continues to exist in a stopped state
once exited. To list all containers, stopped and running, use the `docker ps -a` once exited. To list all running containers, run `docker ps`. To view stopped and running containers,
command. run `docker ps -a`.
## Bind Docker to another host/port or a Unix socket ## Bind Docker to another host/port or a Unix socket
@ -179,16 +185,14 @@ TCP and a Unix socket
## Committing (saving) a container state ## Committing (saving) a container state
Save your containers state to an image, so the state can be To save the current state of a container as an image:
re-used.
When you commit your container, Docker only stores the diff (difference) between
the source image and the current state of the container's image. To list images
you already have, use the `docker images` command.
# Commit your container to a new named image
$ docker commit <container> <some_name> $ docker commit <container> <some_name>
When you commit your container, Docker Engine only stores the diff (difference) between
the source image and the current state of the container's image. To list images
you already have, run:
# List your images # List your images
$ docker images $ docker images
@ -196,6 +200,6 @@ You now have an image state from which you can create new instances.
## Where to go next ## Where to go next
* Work your way through the [Docker User Guide](userguide/index.md) * Work your way through the [Docker Engine User Guide](userguide/index.md)
* Read more about [*Share Images via Repositories*](userguide/containers/dockerrepos.md) * Read more about [Store Images on Docker Hub](userguide/containers/dockerrepos.md)
* Review [*Command Line*](reference/commandline/cli.md) * Review [Command Line](reference/commandline/cli.md)

View File

@ -11,7 +11,6 @@ weight = -82
<![end-metadata]--> <![end-metadata]-->
# Understand the architecture # Understand the architecture
**What is Docker?**
Docker is an open platform for developing, shipping, and running applications. Docker is an open platform for developing, shipping, and running applications.
Docker is designed to deliver your applications faster. With Docker you can Docker is designed to deliver your applications faster. With Docker you can
@ -32,11 +31,11 @@ your hardware.
Surrounding the container is tooling and a platform which can help you in Surrounding the container is tooling and a platform which can help you in
several ways: several ways:
* getting your applications (and supporting components) into Docker containers * Get your applications (and supporting components) into Docker containers
* distributing and shipping those containers to your teams for further development * Distribute and ship those containers to your teams for further development
and testing and testing
* deploying those applications to your production environment, * Deploy those applications to your production environment,
whether it is in a local data center or the Cloud. whether it is in a local data center or the Cloud
## What can I use Docker for? ## What can I use Docker for?
@ -75,7 +74,7 @@ out of the resources you have.
Docker has two major components: Docker has two major components:
* Docker: the open source containerization platform. * Docker Engine: the open source containerization platform.
* [Docker Hub](https://hub.docker.com): our Software-as-a-Service * [Docker Hub](https://hub.docker.com): our Software-as-a-Service
platform for sharing and managing Docker containers. platform for sharing and managing Docker containers.
@ -103,11 +102,11 @@ interface to Docker. It accepts commands from the user and communicates back and
forth with a Docker daemon. forth with a Docker daemon.
### Inside Docker ### Inside Docker
To understand Docker's internals, you need to know about three components: To understand Docker's internals, you need to know about three resources:
* Docker images. * Docker images
* Docker registries. * Docker registries
* Docker containers. * Docker containers
#### Docker images #### Docker images
@ -124,6 +123,8 @@ upload or download images. The public Docker registry is provided with the
images for your use. These can be images you create yourself or you can use images for your use. These can be images you create yourself or you can use
images that others have previously created. Docker registries are the images that others have previously created. Docker registries are the
**distribution** component of Docker. **distribution** component of Docker.
For more information, go to [Docker Registry](https://docs.docker.com/registry/overview/) and
[Docker Trusted Registry](https://docs.docker.com/docker-trusted-registry/overview/).
#### Docker containers #### Docker containers
Docker containers are similar to a directory. A Docker container holds everything that Docker containers are similar to a directory. A Docker container holds everything that
@ -132,17 +133,6 @@ image. Docker containers can be run, started, stopped, moved, and deleted. Each
container is an isolated and secure application platform. Docker containers are the container is an isolated and secure application platform. Docker containers are the
**run** component of Docker. **run** component of Docker.
## So how does Docker work?
So far, we've learned that:
1. You can build Docker images that hold your applications.
2. You can create Docker containers from those Docker images to run your
applications.
3. You can share those Docker images via
[Docker Hub](https://hub.docker.com) or your own registry.
Let's look at how these elements combine together to make Docker work.
### How does a Docker image work? ### How does a Docker image work?
We've already seen that Docker images are read-only templates from which Docker We've already seen that Docker images are read-only templates from which Docker
containers are launched. Each image consists of a series of layers. Docker containers are launched. Each image consists of a series of layers. Docker
@ -163,27 +153,27 @@ or `fedora`, a base Fedora image. You can also use images of your own as the
basis for a new image, for example if you have a base Apache image you could use basis for a new image, for example if you have a base Apache image you could use
this as the base of all your web application images. this as the base of all your web application images.
> **Note:** Docker usually gets these base images from > **Note:** [Docker Hub](https://hub.docker.com) is a public registry and stores
> [Docker Hub](https://hub.docker.com). images.
Docker images are then built from these base images using a simple, descriptive Docker images are then built from these base images using a simple, descriptive
set of steps we call *instructions*. Each instruction creates a new layer in our set of steps we call *instructions*. Each instruction creates a new layer in our
image. Instructions include actions like: image. Instructions include actions like:
* Run a command. * Run a command
* Add a file or directory. * Add a file or directory
* Create an environment variable. * Create an environment variable
* What process to run when launching a container from this image. * What process to run when launching a container from this image
These instructions are stored in a file called a `Dockerfile`. Docker reads this These instructions are stored in a file called a `Dockerfile`. A `Dockerfile` is
`Dockerfile` when you request a build of an image, executes the instructions, and a text based script that contains instructions and commands for building the image
returns a final image. from the base image. Docker reads this `Dockerfile` when you request a build of
an image, executes the instructions, and returns a final image.
### How does a Docker registry work? ### How does a Docker registry work?
The Docker registry is the store for your Docker images. Once you build a Docker The Docker registry is the store for your Docker images. Once you build a Docker
image you can *push* it to a public registry such as the one provided by [Docker image you can *push* it to a public registry such as [Docker Hub](https://hub.docker.com)
Hub](https://hub.docker.com) or to your own registry running behind your or to your own registry running behind your firewall.
firewall.
Using the Docker client, you can search for already published images and then Using the Docker client, you can search for already published images and then
pull them down to your Docker host to build containers from them. pull them down to your Docker host to build containers from them.
@ -209,25 +199,24 @@ daemon to run a container.
$ docker run -i -t ubuntu /bin/bash $ docker run -i -t ubuntu /bin/bash
Let's break down this command. The Docker client is launched using the `docker` The Docker Engine client is launched using the `docker` binary with the `run` option
binary with the `run` option telling it to launch a new container. The bare running a new container. The bare minimum the Docker client needs to tell the
minimum the Docker client needs to tell the Docker daemon to run the container Docker daemon to run the container is:
is:
* What Docker image to build the container from, here `ubuntu`, a base Ubuntu * What Docker image to build the container from, for example, `ubuntu`
image;
* The command you want to run inside the container when it is launched, * The command you want to run inside the container when it is launched,
here `/bin/bash`, to start the Bash shell inside the new container. for example,`/bin/bash`
So what happens under the hood when we run this command? So what happens under the hood when we run this command?
In order, Docker does the following: In order, Docker Engine does the following:
- **Pulls the `ubuntu` image:** Docker checks for the presence of the `ubuntu` - **Pulls the `ubuntu` image:** Docker Engine checks for the presence of the `ubuntu`
image and, if it doesn't exist locally on the host, then Docker downloads it from image. If the image already exists, then Docker Engine uses it for the new container.
[Docker Hub](https://hub.docker.com). If the image already exists, then Docker If it doesn't exist locally on the host, then Docker Engine pulls it from
[Docker Hub](https://hub.docker.com). If the image already exists, then Docker Engine
uses it for the new container. uses it for the new container.
- **Creates a new container:** Once Docker has the image, it uses it to create a - **Creates a new container:** Once Docker Engine has the image, it uses it to create a
container. container.
- **Allocates a filesystem and mounts a read-write _layer_:** The container is created in - **Allocates a filesystem and mounts a read-write _layer_:** The container is created in
the file system and a read-write layer is added to the image. the file system and a read-write layer is added to the image.
@ -238,7 +227,7 @@ Docker container to talk to the local host.
- **Captures and provides application output:** Connects and logs standard input, outputs - **Captures and provides application output:** Connects and logs standard input, outputs
and errors for you to see how your application is running. and errors for you to see how your application is running.
You now have a running container! From here you can manage your container, interact with You now have a running container! Now you can manage your container, interact with
your application and then, when finished, stop and remove your container. your application and then, when finished, stop and remove your container.
## The underlying technology ## The underlying technology
@ -253,40 +242,37 @@ creates a set of *namespaces* for that container.
This provides a layer of isolation: each aspect of a container runs in its own This provides a layer of isolation: each aspect of a container runs in its own
namespace and does not have access outside it. namespace and does not have access outside it.
Some of the namespaces that Docker uses on Linux are: Some of the namespaces that Docker Engine uses on Linux are:
- **The `pid` namespace:** Used for process isolation (PID: Process ID). - **The `pid` namespace:** Process isolation (PID: Process ID).
- **The `net` namespace:** Used for managing network interfaces (NET: - **The `net` namespace:** Managing network interfaces (NET:
Networking). Networking).
- **The `ipc` namespace:** Used for managing access to IPC - **The `ipc` namespace:** Managing access to IPC
resources (IPC: InterProcess Communication). resources (IPC: InterProcess Communication).
- **The `mnt` namespace:** Used for managing mount-points (MNT: Mount). - **The `mnt` namespace:** Managing mount-points (MNT: Mount).
- **The `uts` namespace:** Used for isolating kernel and version identifiers. (UTS: Unix - **The `uts` namespace:** Isolating kernel and version identifiers. (UTS: Unix
Timesharing System). Timesharing System).
### Control groups ### Control groups
Docker on Linux also makes use of another technology called `cgroups` or control groups. Docker Engine on Linux also makes use of another technology called `cgroups` or control groups.
A key to running applications in isolation is to have them only use the A key to running applications in isolation is to have them only use the
resources you want. This ensures containers are good multi-tenant citizens on a resources you want. This ensures containers are good multi-tenant citizens on a
host. Control groups allow Docker to share available hardware resources to host. Control groups allow Docker Engine to share available hardware resources to
containers and, if required, set up limits and constraints. For example, containers and, if required, set up limits and constraints. For example,
limiting the memory available to a specific container. limiting the memory available to a specific container.
### Union file systems ### Union file systems
Union file systems, or UnionFS, are file systems that operate by creating layers, Union file systems, or UnionFS, are file systems that operate by creating layers,
making them very lightweight and fast. Docker uses union file systems to provide making them very lightweight and fast. Docker Engine uses union file systems to provide
the building blocks for containers. Docker can make use of several union file system variants the building blocks for containers. Docker Engine can make use of several union file system variants
including: AUFS, btrfs, vfs, and DeviceMapper. including: AUFS, btrfs, vfs, and DeviceMapper.
### Container format ### Container format
Docker combines these components into a wrapper we call a container format. The Docker Engine combines these components into a wrapper we call a container format. The
default container format is called `libcontainer`. In the future, Docker may default container format is called `libcontainer`. In the future, Docker may
support other container formats, for example, by integrating with BSD Jails support other container formats, for example, by integrating with BSD Jails
or Solaris Zones. or Solaris Zones.
## Next steps ## Next steps
### Installing Docker Read about [Installing Docker Engine](installation/index.md#installation).
Visit the [installation section](installation/index.md#installation). Learn about the [Docker Engine User Guide](userguide/index.md).
### The Docker user guide
[Learn Docker in depth](userguide/index.md).