move the documentation to markdown

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
This commit is contained in:
Sven Dowideit
2014-04-16 11:04:01 +10:00
committed by Sven Dowideit
parent 184728e7bc
commit a777ebcee6
87 changed files with 34848 additions and 347 deletions
+81
View File
@@ -0,0 +1,81 @@
page_title: About Docker
page_description: Docker introduction home page
page_keywords: docker, introduction, documentation, about, technology, understanding, Dockerfile
# About Docker
*Secure And Portable Containers Made Easy*
## Introduction
[**Docker**](http://www.docker.io) is a container based virtualization
framework. Unlike traditional virtualization Docker is fast, lightweight
and easy to use. Docker allows you to create containers holding
all the dependencies for an application. Each container is kept isolated
from any other, and nothing gets shared.
## Docker highlights
- **Containers provide sand-boxing:**
Applications run securely without outside access.
- **Docker allows simple portability:**
Containers are directories, they can be zipped and transported.
- **It all works fast:**
Starting a container is a very fast single process.
- **Docker is easy on the system resources (unlike VMs):**
No more than what each application needs.
- **Agnostic in its _essence_:**
Free of framework, language or platform dependencies.
And most importantly:
- **Docker reduces complexity:**
Docker accepts commands *in plain English*, e.g. `docker run [..]`.
## About this guide
In this introduction we will take you on a tour and show you what
makes Docker tick.
On the [**first page**](introduction/understanding-docker.md), which is
**_informative_**:
- You will find information on Docker;
- And discover Docker's features.
- We will also compare Docker to virtual machines;
- And see some common use cases.
> [Click here to go to Understanding Docker](introduction/understanding-docker.md).
The [**second page**](introduction/technology.md) has **_technical_** information on:
- The architecture of Docker;
- The underlying technology, and;
- *How* Docker works.
> [Click here to go to Understanding the Technology](introduction/technology.md).
On the [**third page**](introduction/working-with-docker.md) we get **_practical_**.
There you can:
- Learn about Docker's components (i.e. Containers, Images and the
Dockerfile);
- And get started working with them straight away.
> [Click here to go to Working with Docker](introduction/working-with-docker.md).
Finally, on the [**fourth**](introduction/get-docker.md) page, we go **_hands on_**
and see:
- The installation instructions, and;
- How Docker makes some hard problems much, much easier.
> [Click here to go to Get Docker](introduction/get-docker.md).
**Note**: We know how valuable your time is. Therefore, the
documentation is prepared in a way to allow anyone to start from any
section need. Although we strongly recommend that you visit
[Understanding Docker](introduction/understanding-docker.md) to see how Docker is
different, if you already have some knowledge and want to quickly get
started with Docker, don't hesitate to jump to [Working with
Docker](introduction/working-with-docker.md).
-29
View File
@@ -1,29 +0,0 @@
:title: Docker Documentation
:description: An overview of the Docker Documentation
:keywords: containers, lxc, concepts, explanation
Introduction
------------
Docker is an open-source engine to easily create lightweight, portable,
self-sufficient containers from any application. The same container that a
developer builds and tests on a laptop can run at scale, in production, on
VMs, bare metal, OpenStack clusters, or any major infrastructure provider.
Common use cases for Docker include:
- Automating the packaging and deployment of web applications.
- Automated testing and continuous integration/deployment.
- Deploying and scaling databases and backend services in a service-oriented environment.
- Building custom PaaS environments, either from scratch or as an extension of off-the-shelf platforms like OpenShift or Cloud Foundry.
Please note Docker is currently under heavy development. It should not be used in production (yet).
For a high-level overview of Docker, please see the `Introduction
<http://www.docker.io/learn_more/>`_. When you're ready to start working with
Docker, we have a `quick start <http://www.docker.io/gettingstarted>`_
and a more in-depth guide to :ref:`ubuntu_linux` and other
:ref:`installation_list` paths including prebuilt binaries,
Rackspace and Amazon instances.
Enough reading! :ref:`Try it out! <running_examples>`
+236
View File
@@ -0,0 +1,236 @@
page_title: The Documentation
page_description: The Docker Index help documentation
page_keywords: Docker, docker, index, accounts, plans, Dockerfile, Docker.io, docs, documentation
# The Documentation
## Docker IO and Docker Index Accounts
You can `search` for Docker images and `pull` them from the [Docker Index]
(https://index.docker.io) without signing in or even having an account. However,
in order to `push` images, leave comments or to *star* a repository, you are going
to need a [Docker IO](https://www.docker.io) account.
### Registration for a Docker IO Account
You can get a Docker IO account by [signing up for one here]
(https://index.docker.io/account/signup/). A valid email address is required to
register, which you will need to verify for account activation.
### Email activation process
You need to have at least one verified email address to be able to use your
Docker IO account. If you can't find the validation email, you can request
another by visiting the [Resend Email Confirmation]
(https://index.docker.io/account/resend-email-confirmation/) page.
### Password reset process
If you can't access your account for some reason, you can reset your password
from the [*Password Reset*](https://www.docker.io/account/forgot-password/)
page.
## Searching for repositories and images
You can `search` for all the publicly available repositories and images using
Docker. If a repository is not public (i.e., private), it won't be listed on
the Index search results. To see repository statuses, you can look at your
[profile page](https://index.docker.io/account/).
## Repositories
### Stars
Stars are a way to show that you like a repository. They are also an easy way
of bookmark your favorites.
### Comments
You can interact with other members of the Docker community and maintainers by
leaving comments on repositories. If you find any comments that are not
appropriate, you can flag them for the Index admins' review.
### Private Docker Repositories
To work with a private repository on the Docker Index, you will need to add one
via the [Add Repository](https://index.docker.io/account/repositories/add) link.
Once the private repository is created, you can `push` and `pull` images to and
from it using Docker.
> *Note:* You need to be signed in and have access to work with a private
> repository.
Private repositories are just like public ones. However, it isn't possible to
browse them or search their content on the public index. They do not get cached
the same way as a public repository either.
It is possible to give access to a private repository to those whom you
designate (i.e., collaborators) from its settings page.
From there, you can also switch repository status (*public* to *private*, or
viceversa). You will need to have an available private repository slot open
before you can do such a switch. If you don't have any, you can always upgrade
your [Docker Index plan](https://index.docker.io/plans/).
### Collaborators and their role
A collaborator is someone you want to give access to a private repository. Once
designated, they can `push` and `pull`. Although, they will not be allowed to
perform any administrative tasks such as deleting the repository or changing its
status from private to public.
> **Note:** A collaborator can not add other collaborators. Only the owner of
> the repository has administrative access.
### Webhooks
You can configure webhooks on the repository settings page. A webhook is called
only after a successful `push` is made. The webhook calls are HTTP POST requests
with a JSON payload similar to the example shown below.
> **Note:** For testing, you can try an HTTP request tool like
> [requestb.in](http://requestb.in/).
*Example webhook JSON payload:*
{
"push_data":{
"pushed_at":1385141110,
"images":[
"imagehash1",
"imagehash2",
"imagehash3"
],
"pusher":"username"
},
"repository":{
"status":"Active",
"description":"my docker repo that does cool things",
"is_trusted":false,
"full_description":"This is my full description",
"repo_url":"https://index.docker.io/u/username/reponame/",
"owner":"username",
"is_official":false,
"is_private":false,
"name":"reponame",
"namespace":"username",
"star_count":1,
"comment_count":1,
"date_created":1370174400,
"dockerfile":"my full dockerfile is listed here",
"repo_name":"username/reponame"
}
}
## Trusted Builds
*Trusted Builds* is a special feature allowing you to specify a source
repository with a *Dockerfile* to be built by the Docker build clusters. The
system will clone your repository and build the Dockerfile using the repository
as the context. The resulting image will then be uploaded to the index and
marked as a `Trusted Build`.
Trusted Builds have a number of advantages. For example, users of *your* Trusted
Build can be certain that the resulting image was built exactly how it claims
to be.
Furthermore, the Dockerfile will be available to anyone browsing your repository
on the Index. Another advantage of the Trusted Builds feature is the automated
builds. This makes sure that your repository is always up to date.
### Linking with a GitHub account
In order to setup a Trusted Build, you need to first link your Docker Index
account with a GitHub one. This will allow the Docker Index to see your
repositories.
> *Note:* We currently request access for *read* and *write* since the Index
> needs to setup a GitHub service hook. Although nothing else is done with
> your account, this is how GitHub manages permissions, sorry!
### Creating a Trusted Build
You can [create a Trusted Build](https://index.docker.io/builds/github/select/)
from any of your public GitHub repositories with a Dockerfile.
> **Note:** We currently only support public repositories. To have more than
> one Docker image from the same GitHub repository, you will need to set up one
> Trusted Build per Dockerfile, each using a different image name. This rule
> applies to building multiple branches on the same GitHub repository as well.
### GitHub organizations
GitHub organizations appear once your membership to that organization is
made public on GitHub. To verify, you can look at the members tab for your
organization on GitHub.
### GitHub service hooks
You can follow the below steps to configure the GitHub service hooks for your
Trusted Build:
<table class="table table-bordered">
<thead>
<tr>
<th>Step</th>
<th>Screenshot</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>1.</td>
<td><img src="https://d207aa93qlcgug.cloudfront.net/0.8/img/github_settings.png"></td>
<td>Login to Github.com, and visit your Repository page. Click on the repository "Settings" link. You will need admin rights to the repository in order to do this. So if you don't have admin rights, you will need to ask someone who does.</td>
</tr>
<tr>
<td>2.</td>
<td><img src="https://d207aa93qlcgug.cloudfront.net/0.8/img/github_service_hooks.png" alt="Service Hooks"></td>
<td>Click on the "Service Hooks" link</td></tr><tr><td>3.</td><td><img src="https://d207aa93qlcgug.cloudfront.net/0.8/img/github_docker_service_hook.png" alt="Find the service hook labeled Docker"></td><td>Find the service hook labeled "Docker" and click on it.</td></tr><tr><td>4.</td><td><img src="https://d207aa93qlcgug.cloudfront.net/0.8/img/github_service_hook_docker_activate.png" alt="Activate Service Hooks"></td>
<td>Click on the "Active" checkbox and then the "Update settings" button, to save changes.</td>
</tr>
</tbody>
</table>
### The Dockerfile and Trusted Builds
During the build process, we copy the contents of your Dockerfile. We also
add it to the Docker Index for the Docker community to see on the repository
page.
### README.md
If you have a `README.md` file in your repository, we will use that as the
repository's full description.
> **Warning:** If you change the full description after a build, it will be
> rewritten the next time the Trusted Build has been built. To make changes,
> modify the README.md from the Git repository. We will look for a README.md
> in the same directory as your Dockerfile.
### Build triggers
If you need another way to trigger your Trusted Builds outside of GitHub, you
can setup a build trigger. When you turn on the build trigger for a Trusted
Build, it will give you a URL to which you can send POST requests. This will
trigger the Trusted Build process, which is similar to GitHub webhooks.
> **Note:** You can only trigger one build at a time and no more than one
> every five minutes. If you have a build already pending, or if you already
> recently submitted a build request, those requests *will be ignored*.
> You can find the logs of last 10 triggers on the settings page to verify
> if everything is working correctly.
### Repository links
Repository links are a way to associate one Trusted Build with another. If one
gets updated, linking system also triggers a build for the other Trusted Build.
This makes it easy to keep your Trusted Builds up to date.
To add a link, go to the settings page of a Trusted Build and click on
*Repository Links*. Then enter the name of the repository that you want have
linked.
> **Warning:** You can add more than one repository link, however, you should
> be very careful. Creating a two way relationship between Trusted Builds will
> cause a never ending build loop.
+13
View File
@@ -0,0 +1,13 @@
page_title: The Docker Index Help
page_description: The Docker Index help documentation home
page_keywords: Docker, docker, index, accounts, plans, Dockerfile, Docker.io, docs, documentation
# The Docker Index Help
## Introduction
For your questions about the [Docker Index](https://index.docker.io) you can
use [this documentation](docs.md).
If you can not find something you are looking for, please feel free to
[contact us](https://index.docker.io/help/support/).
+15
View File
@@ -0,0 +1,15 @@
title
: Documentation
description
: -- todo: change me
keywords
: todo, docker, documentation, basic, builder
Use
===
Contents:
{{ site_name }}
+3 -3
View File
@@ -4,8 +4,8 @@
.. _windows:
Windows
=======
Microsoft Windows
=================
Docker can run on Windows using a virtualization platform like VirtualBox. A Linux
distribution is run inside a virtual machine and that's where Docker will run.
@@ -15,7 +15,7 @@ Installation
.. include:: install_header.inc
1. Install virtualbox from https://www.virtualbox.org - or follow this `tutorial <http://www.slideshare.net/julienbarbier42/install-virtualbox-on-windows-7>`_.
1. Install VirtualBox from https://www.virtualbox.org - or follow this `tutorial <http://www.slideshare.net/julienbarbier42/install-virtualbox-on-windows-7>`_.
2. Download the latest boot2docker.iso from https://github.com/boot2docker/boot2docker/releases.
+77
View File
@@ -0,0 +1,77 @@
page_title: Getting Docker
page_description: Getting Docker and installation tutorials
page_keywords: docker, introduction, documentation, about, technology, understanding, Dockerfile
# Getting Docker
*How to install Docker?*
## Introductions
Once you are comfortable with your level of knowledge of Docker, and
feel like actually trying the product, you can download and start using
it by following the links listed below. There, you will find
installation instructions, specifically tailored for your platform of choice.
## Installation Instructions
### Linux (Native)
- **Arch Linux:**
[Installation on Arch Linux](../installation/archlinux.md)
- **Fedora:**
[Installation on Fedora](../installation/fedora.md)
- **FrugalWare:**
[Installation on FrugalWare](../installation/frugalware.md)
- **Gentoo:**
[Installation on Gentoo](../installation/gentoolinux.md)
- **Red Hat Enterprise Linux:**
[Installation on Red Hat Enterprise Linux](../installation/rhel.md)
- **Ubuntu:**
[Installation on Ubuntu](../installation/ubuntulinux.md)
- **openSUSE:**
[Installation on openSUSE](../installation/openSUSE.md)
### Mac OS X (Using Boot2Docker)
In order to work, Docker makes use of some Linux Kernel features which
are not supported by Mac OS X. To run Docker on OS X we install and run
a lightweight virtual machine and run Docker on that.
- **Mac OS X :**
[Installation on Mac OS X](../installation/mac.md)
### Windows (Using Boot2Docker)
Docker can also run on Windows using a virtual machine. You then run
Linux and Docker inside that virtual machine.
- **Windows:**
[Installation on Windows](../installation/windows.md)
### Infrastructure-as-a-Service
- **Amazon EC2:**
[Installation on Amazon EC2](../installation/amazon.md)
- **Google Cloud Platform:**
[Installation on Google Cloud Platform](../installation/google.md)
- **Rackspace Cloud:**
[Installation on Rackspace Cloud](../installation/rackspace.md)
## Where to go from here
### Understanding Docker
Visit [Understanding Docker](understanding-docker.md) in our Getting Started manual.
### Learn about parts of Docker and the underlying technology
Visit [Understanding the Technology](technology.md) in our Getting Started manual.
### Get practical and learn how to use Docker straight away
Visit [Working with Docker](working-with-docker.md) in our Getting Started manual.
### Get the whole story
[https://www.docker.io/the_whole_story/](https://www.docker.io/the_whole_story/)
+282
View File
@@ -0,0 +1,282 @@
page_title: Understanding the Technology
page_description: Technology of Docker explained in depth
page_keywords: docker, introduction, documentation, about, technology, understanding, Dockerfile
# Understanding the Technology
*What is the architecture of Docker? What is its underlying technology?*
## Introduction
When it comes to understanding Docker and its underlying technology
there is no *magic* involved. Everything is based on tried and tested
features of the *Linux kernel*. Docker either makes use of those
features directly or builds upon them to provide new functionality.
Aside from the technology, one of the major factors that make Docker
great is the way it is built. The project's core is very lightweight and
as much of Docker as possible is designed to be pluggable. Docker is
also built with integration in mind and has a fully featured API that
allows you to access all of the power of Docker from inside your own
applications.
## The Architecture of Docker
Docker is designed for developers and sysadmins. It's built to help you
build applications and services and then deploy them quickly and
efficiently: from development to production.
Let's take a look.
- Docker is a client-server application.
- Both the Docker client and the daemon *can* run on the same system, or;
- You can connect a Docker client with a remote Docker daemon.
- They communicate via sockets or through a RESTful API.
- Users interact with the client to command the daemon, e.g. to create, run, and stop containers.
- The daemon, receiving those commands, does the job, e.g. run a container, stop a container.
_________________
| Host(s) |
The Client Sends Commands |_________________|
------------------------- | |
[docker] <= pull, run => | [docker daemon] |
client | |
| - container 1 |
| - container 2 |
| - .. |
|_______~~________|
||
[The Docker Image Index]
P.S. Do not be put off with this scary looking representation. It's just our ASCII drawing skills. ;-)
## The components of Docker
Docker's main components are:
- Docker *daemon*;
- Docker *client*, and;
- The Docker Index.
### The Docker daemon
As shown on the diagram above, the Docker daemon runs on a host machine.
The user does not directly interact with the daemon, but instead through
an intermediary: the Docker client.
### Docker client
The Docker client is the primary user interface to Docker. It is tasked
with accepting commands from the user and communicating back and forth
with a Docker daemon to manage the container lifecycle on any host.
### Docker Index, the central Docker registry
The [Docker Index](http://index.docker.io) is the global archive (and
directory) of user supplied Docker container images. It currently hosts
a large – in fact, rapidly growing – number of projects where you
can find almost any popular application or deployment stack readily
available to download and run with a single command.
As a social community project, Docker tries to provide all necessary
tools for everyone to grow with other *Dockers*. By issuing a single
command through the Docker client you can start sharing your own
creations with the rest of the world.
However, knowing that not everything can be shared the Docker Index also
offers private repositories. In order to see the available plans, you
can click [here](https://index.docker.io/plans).
Using the [Docker Registry](https://github.com/dotcloud/docker-registry), it is
also possible to run your own private Docker image registry service on your own
servers.
> **Note:** To learn more about the [*Docker Image Index*](
> http://index.docker.io) (public *and* private), check out the [Registry &
> Index Spec](http://docs.docker.io/en/latest/api/registry_index_spec/).
### Summary
- **When you install Docker, you get all the components:**
The daemon, the client and access to the public image registry: the [Docker Index](http://index.docker.io).
- **You can run these components together or distributed:**
Servers with the Docker daemon running, controlled by the Docker client.
- **You can benefit form the public registry:**
Download and build upon images created by the community.
- **You can start a private repository for proprietary use.**
Sign up for a [plan](https://index.docker.io/plans) or host your own [Docker registry](https://github.com/dotcloud/docker-registry).
## Elements of Docker
The basic elements of Docker are:
- **Containers, which allow:**
The run portion of Docker. Your applications run inside of containers.
- **Images, which provide:**
The build portion of Docker. Your containers are built from images.
- **The Dockerfile, which automates:**
A file that contains simple instructions that build Docker images.
To get practical and learn what they are, and **_how to work_** with
them, continue to [Working with Docker](working-with-docker.md). If you would like to
understand **_how they work_**, stay here and continue reading.
## The underlying technology
The power of Docker comes from the underlying technology it is built
from. A series of operating system features are carefully glued together
to provide Docker's features and provide an easy to use interface to
those features. In this section, we will see the main operating system
features that Docker uses to make easy containerization happen.
### Namespaces
Docker takes advantage of a technology called `namespaces` to provide
an isolated workspace we call a *container*. When you run a container,
Docker creates a set of *namespaces* for that container.
This provides a layer of isolation: each process runs in its own
namespace and does not have access outside it.
Some of the namespaces Docker uses are:
- **The `pid` namespace:**
Used for process numbering (PID: Process ID)
- **The `net` namespace:**
Used for managing network interfaces (NET: Networking)
- **The `ipc` namespace:**
Used for managing access to IPC resources (IPC: InterProcess Communication)
- **The `mnt` namespace:**
Used for managing mount-points (MNT: Mount)
- **The `uts` namespace:**
Used for isolating kernel / version identifiers. (UTS: Unix Timesharing System)
### Control groups
Docker also makes use of another technology called `cgroups` or control
groups. A key need to run applications in isolation is to have them
contained, not just in terms of related filesystem and/or dependencies,
but also, resources. Control groups allow Docker to fairly
share available hardware resources to containers and if asked, set up to
limits and constraints, for example limiting the memory to a maximum of 128
MBs.
### UnionFS
UnionFS or union filesystems are filesystems that operate by creating
layers, making them very lightweight and fast. Docker uses union
filesystems to provide the building blocks for containers. We'll see
more about this below.
### Containers
Docker combines these components to build a container format we call
`libcontainer`. Docker also supports traditional Linux containers like
[LXC](https://linuxcontainers.org/) which also make use of these
components.
## How does everything work
A lot happens when Docker creates a container.
Let's see how it works!
### How does a container work?
A container consists of an operating system, user added files and
meta-data. Each container is built from an image. That image tells
Docker what the container holds, what process to run when the container
is launched and a variety of other configuration data. The Docker image
is read-only. When Docker runs a container from an image it adds a
read-write layer on top of the image (using the UnionFS technology we
saw earlier) to run inside the container.
### What happens when you run a container?
The Docker client (or the API!) tells the Docker daemon to run a
container. Let's take a look at a simple `Hello world` example.
$ docker run -i -t ubuntu /bin/bash
Let's break down this command. The Docker client is launched using the
`docker` binary. The bare minimum the Docker client needs to tell the
Docker daemon is:
* What Docker image to build the container from;
* The command you want to run inside the container when it is launched.
So what happens under the covers when we run this command?
Docker begins with:
- **Pulling the `ubuntu` image:**
Docker checks for the presence of the `ubuntu` image and if it doesn't
exist locally on the host, then Docker downloads it from the [Docker Index](https://index.docker.io)
- **Creates a new container:**
Once Docker has the image it creates a container from it.
- **Allocates a filesystem and mounts a read-write _layer_:**
The container is created in the filesystem and a read-write layer is added to the image.
- **Allocates a network / bridge interface:**
Creates a network interface that allows the Docker container to talk to the local host.
- **Sets up an IP address:**
Intelligently finds and attaches an available IP address from a pool.
- **Executes _a_ process that you specify:**
Runs your application, and;
- **Captures and provides application output:**
Connects and logs standard input, outputs and errors for you to see how your application is running.
### How does a Docker Image work?
We've already seen that Docker images are read-only templates that
Docker containers are launched from. When you launch that container it
creates a read-write layer on top of that image that your application is
run in.
Docker images are built using a simple descriptive set of steps we
call *instructions*. Instructions are stored in a file called a
`Dockerfile`. Each instruction writes a new layer to an image using the
UnionFS technology we saw earlier.
Every image starts from a base image, for example `ubuntu` a base Ubuntu
image or `fedora` a base Fedora image. Docker builds and provides these
base images via the [Docker Index](http://index.docker.io).
### How does a Docker registry work?
The Docker registry is a store for your Docker images. Once you build a
Docker image you can *push* it to the [Docker
Index](http://index.docker.io) or to a private registry you run behind
your firewall.
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
(or even build on these images).
The [Docker Index](http://index.docker.io) provides both public and
private storage for images. Public storage is searchable and can be
downloaded by anyone. Private repositories are excluded from search
results and only you and your users can pull them down and use them to
build containers. You can [sign up for a plan here](https://index.docker.io/plans).
To learn more, check out the [Working With Repositories](
http://docs.docker.io/en/latest/use/workingwithrepository) section of our
[User's Manual](http://docs.docker.io).
## Where to go from here
### Understanding Docker
Visit [Understanding Docker](understanding-docker.md) in our Getting Started manual.
### Get practical and learn how to use Docker straight away
Visit [Working with Docker](working-with-docker.md) in our Getting Started manual.
### Get the product and go hands-on
Visit [Get Docker](get-docker.md) in our Getting Started manual.
### Get the whole story
[https://www.docker.io/the_whole_story/](https://www.docker.io/the_whole_story/)
@@ -0,0 +1,272 @@
page_title: Understanding Docker
page_description: Docker explained in depth
page_keywords: docker, introduction, documentation, about, technology, understanding, Dockerfile
# Understanding Docker
*What is Docker? What makes it great?*
Building development lifecycles, pipelines and deployment tooling is
hard. It's not easy to create portable applications and services.
There's often high friction getting code from your development
environment to production. It's also hard to ensure those applications
and services are consistent, up-to-date and managed.
Docker is designed to solve these problem for both developers and
sysadmins. It is a lightweight framework (with a powerful API) that
provides a lifecycle for building and deploying applications into
containers.
Docker provides a way to run almost any application securely isolated
into a container. The isolation and security allows you to run many
containers simultaneously on your host. The lightweight nature of
containers, which run without the extra overload of a hypervisor, means
you can get more out of your hardware.
**Note:** Docker itself is *shipped* with the Apache 2.0 license and it
is completely open-source — *the pun? very much intended*.
### What are the Docker basics I need to know?
Docker has three major components:
* Docker containers.
* Docker images.
* Docker registries.
#### Docker containers
Docker containers are like a directory. A Docker container holds
everything that is needed for an application to run. Each container is
created from a Docker image. Docker containers can be run, started,
stopped, moved and deleted. Each container is an isolated and secure
application platform. You can consider Docker containers the *run*
portion of the Docker framework.
#### Docker images
The Docker image is a template, for example an Ubuntu
operating system with Apache and your web application installed. Docker
containers are launched from images. Docker provides a simple way to
build new images or update existing images. You can consider Docker
images to be the *build* portion of the Docker framework.
#### Docker Registries
Docker registries hold images. These are public (or private!) stores
that you can upload or download images to and from. These images can be
images you create yourself or you can make use of images that others
have previously created. Docker registries allow you to build simple and
powerful development and deployment work flows. You can consider Docker
registries the *share* portion of the Docker framework.
### How does Docker work?
Docker is a client-server framework. The Docker *client* commands the Docker
*daemon*, which in turn creates, builds and manages containers.
The Docker daemon takes advantage of some neat Linux kernel and
operating system features, like `namespaces` and `cgroups`, to build
isolated container. Docker provides a simple abstraction layer to these
technologies.
> **Note:** If you would like to learn more about the underlying technology,
> why not jump to [Understanding the Technology](technology.md) where we talk about them? You can
> always come back here to continue learning about features of Docker and what
> makes it different.
## Features of Docker
In order to get a good grasp of the capabilities of Docker you should
read the [User's Manual](http://docs.docker.io). Let's look at a summary
of Docker's features to give you an idea of how Docker might be useful
to you.
### User centric and simple to use
*Docker is made for humans.*
It's easy to get started and easy to build and deploy applications with
Docker: or as we say "*dockerise*" them! As much of Docker as possible
uses plain English for commands and tries to be as lightweight and
transparent as possible. We want to get out of the way so you can build
and deploy your applications.
### Docker is Portable
*Dockerise And Go!*
Docker containers are highly portable. Docker provides a standard
container format to hold your applications:
* You take care of your applications inside the container, and;
* Docker takes care of managing the container.
Any machine, be it bare-metal or virtualized, can run any Docker
container. The sole requirement is to have Docker installed.
**This translates to:**
- Reliability;
- Freeing your applications out of the dependency-hell;
- A natural guarantee that things will work, anywhere.
### Lightweight
*No more resources waste.*
Containers are lightweight, in fact, they are extremely lightweight.
Unlike traditional virtual machines, which have the overhead of a
hypervisor, Docker relies on operating system level features to provide
isolation and security. A Docker container does not need anything more
than what your application needs to run.
This translates to:
- Ability to deploy a large number of applications on a single system;
- Lightning fast start up times and reduced overhead.
### Docker can run anything
*An amazing host! (again, pun intended.)*
Docker isn't prescriptive about what applications or services you can run
inside containers. We provide use cases and examples for running web
services, databases, applications - just about anything you can imagine
can run in a Docker container.
**This translates to:**
- Ability to run a wide range of applications;
- Ability to deploy reliably without repeating yourself.
### Plays well with others
*A wonderful guest.*
Today, it is possible to install and use Docker almost anywhere. Even on
non-Linux systems such as Windows or Mac OS X thanks to a project called
[Boot2Docker](http://boot2docker.io).
**This translates to running Docker (and Docker containers!) _anywhere_:**
- **Linux:**
Ubuntu, CentOS / RHEL, Fedora, Gentoo, openSUSE and more.
- **Infrastructure-as-a-Service:**
Amazon AWS, Google GCE, Rackspace Cloud and probably, your favorite IaaS.
- **Microsoft Windows**
- **OS X**
### Docker is Responsible
*A tool that you can trust.*
Docker does not just bring you a set of tools to isolate and run
applications. It also allows you to specify constraints and controls on
those resources.
**This translates to:**
- Fine tuning available resources for each application;
- Allocating memory or CPU intelligently to make most of your environment;
Without dealing with complicated commands or third party applications.
### Docker is Social
*Docker knows that No One Is an Island.*
Docker allows you to share the images you've built with the world. And
lots of people have already shared their own images.
To facilitate this sharing Docker comes with a public registry and index
called the [Docker Index](http://index.docker.io). If you don't want
your images to be public you can also use private images on the Index or
even run your own registry behind your firewall.
**This translates to:**
- No more wasting time building everything from scratch;
- Easily and quickly save your application stack;
- Share and benefit from the depth of the Docker community.
## Docker versus Virtual Machines
> I suppose it is tempting, if the *only* tool you have is a hammer, to
> treat *everything* as if it were a nail.
> — **_Abraham Maslow_**
**Docker containers are:**
- Easy on the resources;
- Extremely light to deal with;
- Do not come with substantial overhead;
- Very easy to work with;
- Agnostic;
- Can work *on* virtual machines;
- Secure and isolated;
- *Artful*, *social*, *fun*, and;
- Powerful sand-boxes.
**Docker containers are not:**
- Hardware or OS emulators;
- Resource heavy;
- Platform, software or language dependent.
## Docker Use Cases
Docker is a framework. As a result it's flexible and powerful enough to
be used in a lot of different use cases.
### For developers
- **Developed with developers in mind:**
Build, test and ship applications with nothing but Docker and lean
containers.
- **Re-usable building blocks to create more:**
Docker images are easily updated building blocks.
- **Automatically build-able:**
It has never been this easy to build - *anything*.
- **Easy to integrate:**
A powerful, fully featured API allows you to integrate Docker into your tooling.
### For sysadmins
- **Efficient (and DevOps friendly!) lifecycle:**
Operations and developments are consistent, repeatable and reliable.
- **Balanced environments:**
Processes between development, testing and production are leveled.
- **Improvements on speed and integration:**
Containers are almost nothing more than isolated, secure processes.
- **Lowered costs of infrastructure:**
Containers are lightweight and heavy on resources compared to virtual machines.
- **Portable configurations:**
Issues and overheads with dealing with configurations and systems are eliminated.
### For everyone
- **Increased security without performance loss:**
Replacing VMs with containers provide security without additional
hardware (or software).
- **Portable:**
You can easily move applications and workloads from different operating
systems and platforms.
## Where to go from here
### Learn about Parts of Docker and the underlying technology
Visit [Understanding the Technology](technology.md) in our Getting Started manual.
### Get practical and learn how to use Docker straight away
Visit [Working with Docker](working-with-docker.md) in our Getting Started manual.
### Get the product and go hands-on
Visit [Get Docker](get-docker.md) in our Getting Started manual.
### Get the whole story
[https://www.docker.io/the_whole_story/](https://www.docker.io/the_whole_story/)
@@ -0,0 +1,408 @@
page_title: Working with Docker and the Dockerfile
page_description: Working with Docker and The Dockerfile explained in depth
page_keywords: docker, introduction, documentation, about, technology, understanding, Dockerfile
# Working with Docker and the Dockerfile
*How to use and work with Docker?*
> **Warning! Don't let this long page bore you.**
> If you prefer a summary and would like to see how a specific command
> works, check out the glossary of all available client
> commands on our [User's Manual: Commands Reference](
> http://docs.docker.io/en/latest/reference/commandline/cli).
## Introduction
On the last page, [Understanding the Technology](technology.md), we covered the
components that make up Docker and learnt about the
underlying technology and *how* everything works.
Now, it is time to get practical and see *how to work with* the Docker client,
Docker containers and images and the `Dockerfile`.
> **Note:** You are encouraged to take a good look at the container,
> image and `Dockerfile` explanations here to have a better understanding
> on what exactly they are and to get an overall idea on how to work with
> them. On the next page (i.e., [Get Docker](get-docker.md)), you will be
> able to find links for platform-centric installation instructions.
## Elements of Docker
As we mentioned on the, [Understanding the Technology](technology.md) page, the main
elements of Docker are:
- Containers;
- Images, and;
- The `Dockerfile`.
> **Note:** This page is more *practical* than *technical*. If you are
> interested in understanding how these tools work behind the scenes
> and do their job, you can always read more on
> [Understanding the Technology](technology.md).
## Working with the Docker client
In order to work with the Docker client, you need to have a host with
the Docker daemon installed and running.
### How to use the client
The client provides you a command-line interface to Docker. It is
accessed by running the `docker` binary.
> **Tip:** The below instructions can be considered a summary of our
> *interactive tutorial*. If you prefer a more hands-on approach without
> installing anything, why not give that a shot and check out the
> [Docker Interactive Tutorial](http://www.docker.io/interactivetutorial).
The `docker` client usage consists of passing a chain of arguments:
# Usage: [sudo] docker [option] [command] [arguments] ..
# Example:
docker run -i -t ubuntu /bin/bash
### Our first Docker command
Let's get started with our first Docker command by checking the
version of the currently installed Docker client using the `docker
version` command.
# Usage: [sudo] docker version
# Example:
docker version
This command will not only provide you the version of Docker client you
are using, but also the version of Go (the programming language powering
Docker).
Client version: 0.8.0
Go version (client): go1.2
Git commit (client): cc3a8c8
Server version: 0.8.0
Git commit (server): cc3a8c8
Go version (server): go1.2
Last stable version: 0.8.0
### Finding out all available commands
The user-centric nature of Docker means providing you a constant stream
of helpful instructions. This begins with the client itself.
In order to get a full list of available commands run the `docker`
binary:
# Usage: [sudo] docker
# Example:
docker
You will get an output with all currently available commands.
Commands:
attach Attach to a running container
build Build a container from a Dockerfile
commit Create a new image from a container's changes
. . .
### Command usage instructions
The same way used to learn all available commands can be repeated to find
out usage instructions for a specific command.
Try typing Docker followed with a `[command]` to see the instructions:
# Usage: [sudo] docker [command] [--help]
# Example:
docker attach
Help outputs . . .
Or you can pass the `--help` flag to the `docker` binary.
docker images --help
You will get an output with all available options:
Usage: docker attach [OPTIONS] CONTAINER
Attach to a running container
--no-stdin=false: Do not attach stdin
--sig-proxy=true: Proxify all received signal to the process (even in non-tty mode)
## Working with images
### Docker Images
As we've discovered a Docker image is a read-only template that we build
containers from. Every Docker container is launched from an image and
you can use both images provided by others, for example we've discovered
the base `ubuntu` image provided by Docker, as well as images built by
others. For example we can build an image that runs Apache and our own
web application as a starting point to launch containers.
### Searching for images
To search for Docker image we use the `docker search` command. The
`docker search` command returns a list of all images that match your
search criteria together with additional, useful information about that
image. This includes information such as social metrics like how many
other people like the image - we call these "likes" *stars*. We also
tell you if an image is *trusted*. A *trusted* image is built from a
known source and allows you to introspect in greater detail how the
image is constructed.
# Usage: [sudo] docker search [image name]
# Example:
docker search nginx
NAME DESCRIPTION STARS OFFICIAL TRUSTED
dockerfile/nginx Trusted Nginx (http://nginx.org/) Build 6 [OK]
paintedfox/nginx-php5 A docker image for running Nginx with PHP5. 3 [OK]
dockerfiles/django-uwsgi-nginx Dockerfile and configuration files to buil... 2 [OK]
. . .
> **Note:** To learn more about trusted builds, check out [this]
(http://blog.docker.io/2013/11/introducing-trusted-builds) blog post.
### Downloading an image
Downloading a Docker image is called *pulling*. To do this we hence use the
`docker pull` command.
# Usage: [sudo] docker pull [image name]
# Example:
docker pull dockerfile/nginx
Pulling repository dockerfile/nginx
0ade68db1d05: Pulling dependent layers
27cf78414709: Download complete
b750fe79269d: Download complete
. . .
As you can see, Docker will download, one by one, all the layers forming
the final image. This demonstrates the *building block* philosophy of
Docker.
### Listing available images
In order to get a full list of available images, you can use the
`docker images` command.
# Usage: [sudo] docker images
# Example:
docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
myUserName/nginx latest a0d6c70867d2 41 seconds ago 578.8 MB
nginx latest 173c2dd28ab2 3 minutes ago 578.8 MB
dockerfile/nginx latest 0ade68db1d05 3 weeks ago 578.8 MB
## Working with containers
### Docker Containers
Docker containers are directories on your Docker host that are built
from Docker images. In order to create or start a container, you need an
image. This could be the base `ubuntu` image or an image built and
shared with you or an image you've built yourself.
### Running a new container from an image
The easiest way to create a new container is to *run* one from an image.
# Usage: [sudo] docker run [arguments] ..
# Example:
docker run -d --name nginx_web nginx /usr/sbin/nginx
This will create a new container from an image called `nginx` which will
launch the command `/usr/sbin/nginx` when the container is run. We've
also given our container a name, `nginx_web`.
Containers can be run in two modes:
* Interactive;
* Daemonized;
An interactive container runs in the foreground and you can connect to
it and interact with it. A daemonized container runs in the background.
A container will run as long as the process you have launched inside it
is running, for example if the `/usr/bin/nginx` process stops running
the container will also stop.
### Listing containers
We can see a list of all the containers on our host using the `docker
ps` command. By default the `docker ps` commands only shows running
containers. But we can also add the `-a` flag to show *all* containers -
both running and stopped.
# Usage: [sudo] docker ps [-a]
# Example:
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
842a50a13032 dockerfile/nginx:latest nginx 35 minutes ago Up 30 minutes 0.0.0.0:80->80/tcp nginx_web
### Stopping a container
You can use the `docker stop` command to stop an active container. This will gracefully
end the active process.
# Usage: [sudo] docker stop [container ID]
# Example:
docker stop nginx_web
nginx_web
If the `docker stop` command succeeds it will return the name of
the container it has stopped.
### Starting a Container
Stopped containers can be started again.
# Usage: [sudo] docker start [container ID]
# Example:
docker start nginx_web
nginx_web
If the `docker start` command succeeds it will return the name of the
freshly started container.
## Working with the Dockerfile
The `Dockerfile` holds the set of instructions Docker uses to build a Docker image.
> **Tip:** Below is a short summary of our full Dockerfile tutorial. In
> order to get a better-grasp of how to work with these automation
> scripts, check out the [Dockerfile step-by-step
> tutorial](http://www.docker.io/learn/dockerfile).
A `Dockerfile` contains instructions written in the following format:
# Usage: Instruction [arguments / command] ..
# Example:
FROM ubuntu
A `#` sign is used to provide a comment:
# Comments ..
> **Tip:** The `Dockerfile` is very flexible and provides a powerful set
> of instructions for building applications. To learn more about the
> `Dockerfile` and it's instructions see the [Dockerfile
> Reference](http://docs.docker.io/en/latest/reference/builder).
### First steps with the Dockerfile
It's a good idea to add some comments to the start of your `Dockerfile`
to provide explanation and exposition to any future consumers, for
example:
#
# Dockerfile to install Nginx
# VERSION 2 - EDITION 1
The first instruction in any `Dockerfile` must be the `FROM` instruction. The `FROM` instruction specifies the image name that this new image is built from, it is often a base image like `ubuntu`.
# Base image used is Ubuntu:
FROM ubuntu
Next, we recommend you use the `MAINTAINER` instruction to tell people who manages this image.
# Maintainer: O.S. Tezer <ostezer at gmail com> (@ostezer)
MAINTAINER O.S. Tezer, ostezer@gmail.com
After this we can add additional instructions that represent the steps
to build our actual image.
### Our Dockerfile so far
So far our `Dockerfile` will look like.
# Dockerfile to install Nginx
# VERSION 2 - EDITION 1
FROM ubuntu
MAINTAINER O.S. Tezer, ostezer@gmail.com
Let's install a package and configure an application inside our image. To do this we use a new
instruction: `RUN`. The `RUN` instruction executes commands inside our
image, for example. The instruction is just like running a command on
the command line inside a container.
RUN echo "deb http://archive.ubuntu.com/ubuntu/ raring main universe" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y nginx
RUN echo "\ndaemon off;" >> /etc/nginx/nginx.conf
We can see here that we've *run* four instructions. Each time we run an
instruction a new layer is added to our image. Here's we've added an
Ubuntu package repository, updated the packages, installed the `nginx`
package and then echo'ed some configuration to the default
`/etc/nginx/nginx.conf` configuration file.
Let's specify another instruction, `CMD`, that tells Docker what command
to run when a container is created from this image.
CMD /usr/sbin/nginx
We can now save this file and use it build an image.
### Using a Dockerfile
Docker uses the `Dockerfile` to build images. The build process is initiated by the `docker build` command.
# Use the Dockerfile at the current location
# Usage: [sudo] docker build .
# Example:
docker build -t="my_nginx_image" .
Uploading context 25.09 kB
Uploading context
Step 0 : FROM ubuntu
---> 9cd978db300e
Step 1 : MAINTAINER O.S. Tezer, ostezer@gmail.com
---> Using cache
---> 467542d0cdd3
Step 2 : RUN echo "deb http://archive.ubuntu.com/ubuntu/ raring main universe" >> /etc/apt/sources.list
---> Using cache
---> 0a688bd2a48c
Step 3 : RUN apt-get update
---> Running in de2937e8915a
. . .
Step 10 : CMD /usr/sbin/nginx
---> Running in b4908b9b9868
---> 626e92c5fab1
Successfully built 626e92c5fab1
Here we can see that Docker has executed each instruction in turn and
each instruction has created a new layer in turn and each layer identified
by a new ID. The `-t` flag allows us to specify a name for our new
image, here `my_nginx_image`.
We can see our new image using the `docker images` command.
docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
my_nginx_img latest 626e92c5fab1 57 seconds ago 337.6 MB
## Where to go from here
### Understanding Docker
Visit [Understanding Docker](understanding-docker.md) in our Getting Started manual.
### Learn about parts of Docker and the underlying technology
Visit [Understanding the Technology](technology.md) in our Getting Started manual.
### Get the product and go hands-on
Visit [Get Docker](get-docker.md) in our Getting Started manual.
### Get the whole story
[https://www.docker.io/the_whole_story/](https://www.docker.io/the_whole_story/)
+9
View File
@@ -0,0 +1,9 @@
# Search
<form id="content_search" action="/jsearch/">
<span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span>
<input name="q" id="tipue_search_input" type="text" class="search_input search-query ui-autocomplete-input" placeholder="Search the Docs" autocomplete="off">
</form>
<div id="tipue_search_content">
</div>
@@ -0,0 +1,998 @@
page_title: Remote API v1.0
page_description: API Documentation for Docker
page_keywords: API, Docker, rcli, REST, documentation
# [Docker Remote API v1.0](#id1)
Table of Contents
- [Docker Remote API v1.0](#docker-remote-api-v1-0)
- [1. Brief introduction](#brief-introduction)
- [2. Endpoints](#endpoints)
- [2.1 Containers](#containers)
- [List containers](#list-containers)
- [Create a container](#create-a-container)
- [Inspect a container](#inspect-a-container)
- [Inspect changes on a container’s
filesystem](#inspect-changes-on-a-container-s-filesystem)
- [Export a container](#export-a-container)
- [Start a container](#start-a-container)
- [Stop a container](#stop-a-container)
- [Restart a container](#restart-a-container)
- [Kill a container](#kill-a-container)
- [Attach to a container](#attach-to-a-container)
- [Wait a container](#wait-a-container)
- [Remove a container](#remove-a-container)
- [2.2 Images](#images)
- [List Images](#list-images)
- [Create an image](#create-an-image)
- [Insert a file in an image](#insert-a-file-in-an-image)
- [Inspect an image](#inspect-an-image)
- [Get the history of an
image](#get-the-history-of-an-image)
- [Push an image on the
registry](#push-an-image-on-the-registry)
- [Tag an image into a
repository](#tag-an-image-into-a-repository)
- [Remove an image](#remove-an-image)
- [Search images](#search-images)
- [2.3 Misc](#misc)
- [Build an image from Dockerfile via
stdin](#build-an-image-from-dockerfile-via-stdin)
- [Get default username and
email](#get-default-username-and-email)
- [Check auth configuration and store
it](#check-auth-configuration-and-store-it)
- [Display system-wide
information](#display-system-wide-information)
- [Show the docker version
information](#show-the-docker-version-information)
- [Create a new image from a container’s
changes](#create-a-new-image-from-a-container-s-changes)
- [3. Going further](#going-further)
- [3.1 Inside ‘docker run’](#inside-docker-run)
- [3.2 Hijacking](#hijacking)
## [1. Brief introduction](#id2)
- The Remote API is replacing rcli
- Default port in the docker daemon is 4243
- The API tends to be REST, but for some complex commands, like attach
or pull, the HTTP connection is hijacked to transport stdout stdin
and stderr
## [2. Endpoints](#id3)
### [2.1 Containers](#id4)
#### [List containers](#id5)
`GET /containers/json`
: List containers
**Example request**:
GET /containers/json?all=1&before=8dfafdbc3a40 HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"Id": "8dfafdbc3a40",
"Image": "ubuntu:latest",
"Command": "echo 1",
"Created": 1367854155,
"Status": "Exit 0"
},
{
"Id": "9cd87474be90",
"Image": "ubuntu:latest",
"Command": "echo 222222",
"Created": 1367854155,
"Status": "Exit 0"
},
{
"Id": "3176a2479c92",
"Image": "centos:latest",
"Command": "echo 3333333333333333",
"Created": 1367854154,
"Status": "Exit 0"
},
{
"Id": "4cb07b47f9fb",
"Image": "fedora:latest",
"Command": "echo 444444444444444444444444444444444",
"Created": 1367854152,
"Status": "Exit 0"
}
]
Query Parameters:
 
- **all** – 1/True/true or 0/False/false, Show all containers.
Only running containers are shown by default
- **limit** – Show `limit` last created
containers, include non-running ones.
- **since** – Show only containers created since Id, include
non-running ones.
- **before** – Show only containers created before Id, include
non-running ones.
Status Codes:
- **200** – no error
- **400** – bad parameter
- **500** – server error
#### [Create a container](#id6)
`POST /containers/create`
: Create a container
**Example request**:
POST /containers/create HTTP/1.1
Content-Type: application/json
{
"Hostname":"",
"User":"",
"Memory":0,
"MemorySwap":0,
"AttachStdin":false,
"AttachStdout":true,
"AttachStderr":true,
"PortSpecs":null,
"Tty":false,
"OpenStdin":false,
"StdinOnce":false,
"Env":null,
"Cmd":[
"date"
],
"Dns":null,
"Image":"ubuntu",
"Volumes":{},
"VolumesFrom":""
}
**Example response**:
HTTP/1.1 201 OK
Content-Type: application/json
{
"Id":"e90e34656806"
"Warnings":[]
}
Json Parameters:
 
- **config** – the container’s configuration
Status Codes:
- **201** – no error
- **404** – no such container
- **406** – impossible to attach (container not running)
- **500** – server error
#### [Inspect a container](#id7)
`GET /containers/`(*id*)`/json`
: Return low-level information on the container `id`
**Example request**:
GET /containers/4fa6e0f0c678/json HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/json
{
"Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2",
"Created": "2013-05-07T14:51:42.041847+02:00",
"Path": "date",
"Args": [],
"Config": {
"Hostname": "4fa6e0f0c678",
"User": "",
"Memory": 0,
"MemorySwap": 0,
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"PortSpecs": null,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": null,
"Cmd": [
"date"
],
"Dns": null,
"Image": "ubuntu",
"Volumes": {},
"VolumesFrom": ""
},
"State": {
"Running": false,
"Pid": 0,
"ExitCode": 0,
"StartedAt": "2013-05-07T14:51:42.087658+02:01360",
"Ghost": false
},
"Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
"NetworkSettings": {
"IpAddress": "",
"IpPrefixLen": 0,
"Gateway": "",
"Bridge": "",
"PortMapping": null
},
"SysInitPath": "/home/kitty/go/src/github.com/dotcloud/docker/bin/docker",
"ResolvConfPath": "/etc/resolv.conf",
"Volumes": {}
}
Status Codes:
- **200** – no error
- **404** – no such container
- **500** – server error
#### [Inspect changes on a container’s filesystem](#id8)
`GET /containers/`(*id*)`/changes`
: Inspect changes on container `id` ‘s filesystem
**Example request**:
GET /containers/4fa6e0f0c678/changes HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"Path":"/dev",
"Kind":0
},
{
"Path":"/dev/kmsg",
"Kind":1
},
{
"Path":"/test",
"Kind":1
}
]
Status Codes:
- **200** – no error
- **404** – no such container
- **500** – server error
#### [Export a container](#id9)
`GET /containers/`(*id*)`/export`
: Export the contents of container `id`
**Example request**:
GET /containers/4fa6e0f0c678/export HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/octet-stream
{{ STREAM }}
Status Codes:
- **200** – no error
- **404** – no such container
- **500** – server error
#### [Start a container](#id10)
`POST /containers/`(*id*)`/start`
: Start the container `id`
**Example request**:
POST /containers/e90e34656806/start HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Status Codes:
- **200** – no error
- **404** – no such container
- **500** – server error
#### [Stop a container](#id11)
`POST /containers/`(*id*)`/stop`
: Stop the container `id`
**Example request**:
POST /containers/e90e34656806/stop?t=5 HTTP/1.1
**Example response**:
HTTP/1.1 204 OK
Query Parameters:
 
- **t** – number of seconds to wait before killing the container
Status Codes:
- **204** – no error
- **404** – no such container
- **500** – server error
#### [Restart a container](#id12)
`POST /containers/`(*id*)`/restart`
: Restart the container `id`
**Example request**:
POST /containers/e90e34656806/restart?t=5 HTTP/1.1
**Example response**:
HTTP/1.1 204 OK
Query Parameters:
 
- **t** – number of seconds to wait before killing the container
Status Codes:
- **204** – no error
- **404** – no such container
- **500** – server error
#### [Kill a container](#id13)
`POST /containers/`(*id*)`/kill`
: Kill the container `id`
**Example request**:
POST /containers/e90e34656806/kill HTTP/1.1
**Example response**:
HTTP/1.1 204 OK
Status Codes:
- **204** – no error
- **404** – no such container
- **500** – server error
#### [Attach to a container](#id14)
`POST /containers/`(*id*)`/attach`
: Attach to the container `id`
**Example request**:
POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/vnd.docker.raw-stream
{{ STREAM }}
Query Parameters:
 
- **logs** – 1/True/true or 0/False/false, return logs. Default
false
- **stream** – 1/True/true or 0/False/false, return stream.
Default false
- **stdin** – 1/True/true or 0/False/false, if stream=true, attach
to stdin. Default false
- **stdout** – 1/True/true or 0/False/false, if logs=true, return
stdout log, if stream=true, attach to stdout. Default false
- **stderr** – 1/True/true or 0/False/false, if logs=true, return
stderr log, if stream=true, attach to stderr. Default false
Status Codes:
- **200** – no error
- **400** – bad parameter
- **404** – no such container
- **500** – server error
#### [Wait a container](#id15)
`POST /containers/`(*id*)`/wait`
: Block until container `id` stops, then returns
the exit code
**Example request**:
POST /containers/16253994b7c4/wait HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/json
{"StatusCode":0}
Status Codes:
- **200** – no error
- **404** – no such container
- **500** – server error
#### [Remove a container](#id16)
`DELETE /containers/`(*id*)
: Remove the container `id` from the filesystem
**Example request**:
DELETE /containers/16253994b7c4?v=1 HTTP/1.1
**Example response**:
HTTP/1.1 204 OK
Query Parameters:
 
- **v** – 1/True/true or 0/False/false, Remove the volumes
associated to the container. Default false
Status Codes:
- **204** – no error
- **400** – bad parameter
- **404** – no such container
- **500** – server error
### [2.2 Images](#id17)
#### [List Images](#id18)
`GET /images/`(*format*)
: List images `format` could be json or viz (json
default)
**Example request**:
GET /images/json?all=0 HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"Repository":"ubuntu",
"Tag":"precise",
"Id":"b750fe79269d",
"Created":1364102658
},
{
"Repository":"ubuntu",
"Tag":"12.04",
"Id":"b750fe79269d",
"Created":1364102658
}
]
**Example request**:
GET /images/viz HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: text/plain
digraph docker {
"d82cbacda43a" -> "074be284591f"
"1496068ca813" -> "08306dc45919"
"08306dc45919" -> "0e7893146ac2"
"b750fe79269d" -> "1496068ca813"
base -> "27cf78414709" [style=invis]
"f71189fff3de" -> "9a33b36209ed"
"27cf78414709" -> "b750fe79269d"
"0e7893146ac2" -> "d6434d954665"
"d6434d954665" -> "d82cbacda43a"
base -> "e9aa60c60128" [style=invis]
"074be284591f" -> "f71189fff3de"
"b750fe79269d" [label="b750fe79269d\nubuntu",shape=box,fillcolor="paleturquoise",style="filled,rounded"];
"e9aa60c60128" [label="e9aa60c60128\ncentos",shape=box,fillcolor="paleturquoise",style="filled,rounded"];
"9a33b36209ed" [label="9a33b36209ed\nfedora",shape=box,fillcolor="paleturquoise",style="filled,rounded"];
base [style=invisible]
}
Query Parameters:
 
- **all** – 1/True/true or 0/False/false, Show all containers.
Only running containers are shown by default
Status Codes:
- **200** – no error
- **400** – bad parameter
- **500** – server error
#### [Create an image](#id19)
`POST /images/create`
: Create an image, either by pull it from the registry or by importing
it
**Example request**:
POST /images/create?fromImage=ubuntu HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/vnd.docker.raw-stream
{{ STREAM }}
Query Parameters:
 
- **fromImage** – name of the image to pull
- **fromSrc** – source to import, - means stdin
- **repo** – repository
- **tag** – tag
- **registry** – the registry to pull from
Status Codes:
- **200** – no error
- **500** – server error
#### [Insert a file in an image](#id20)
`POST /images/`(*name*)`/insert`
: Insert a file from `url` in the image
`name` at `path`
**Example request**:
POST /images/test/insert?path=/usr&url=myurl HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
{{ STREAM }}
Status Codes:
- **200** – no error
- **500** – server error
#### [Inspect an image](#id21)
`GET /images/`(*name*)`/json`
: Return low-level information on the image `name`
**Example request**:
GET /images/centos/json HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc",
"parent":"27cf784147099545",
"created":"2013-03-23T22:24:18.818426-07:00",
"container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0",
"container_config":
{
"Hostname":"",
"User":"",
"Memory":0,
"MemorySwap":0,
"AttachStdin":false,
"AttachStdout":false,
"AttachStderr":false,
"PortSpecs":null,
"Tty":true,
"OpenStdin":true,
"StdinOnce":false,
"Env":null,
"Cmd": ["/bin/bash"]
,"Dns":null,
"Image":"centos",
"Volumes":null,
"VolumesFrom":""
}
}
Status Codes:
- **200** – no error
- **404** – no such image
- **500** – server error
#### [Get the history of an image](#id22)
`GET /images/`(*name*)`/history`
: Return the history of the image `name`
**Example request**:
GET /images/fedora/history HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"Id":"b750fe79269d",
"Created":1364102658,
"CreatedBy":"/bin/bash"
},
{
"Id":"27cf78414709",
"Created":1364068391,
"CreatedBy":""
}
]
Status Codes:
- **200** – no error
- **404** – no such image
- **500** – server error
#### [Push an image on the registry](#id23)
`POST /images/`(*name*)`/push`
: Push the image `name` on the registry
> **Example request**:
>
> POST /images/test/push HTTP/1.1
>
> **Example response**:
HTTP/1.1 200 OK
Content-Type: application/vnd.docker.raw-stream
{{ STREAM }}
Query Parameters:
 
- **registry** – the registry you wan to push, optional
Status Codes:
- **200** – no error
- **404** – no such image
- **500** – server error
#### [Tag an image into a repository](#id24)
`POST /images/`(*name*)`/tag`
: Tag the image `name` into a repository
**Example request**:
POST /images/test/tag?repo=myrepo&force=0 HTTP/1.1
**Example response**:
HTTP/1.1 201 OK
Query Parameters:
 
- **repo** – The repository to tag in
- **force** – 1/True/true or 0/False/false, default false
Status Codes:
- **201** – no error
- **400** – bad parameter
- **404** – no such image
- **500** – server error
#### [Remove an image](#id25)
`DELETE /images/`(*name*)
: Remove the image `name` from the filesystem
**Example request**:
DELETE /images/test HTTP/1.1
**Example response**:
HTTP/1.1 204 OK
Status Codes:
- **204** – no error
- **404** – no such image
- **500** – server error
#### [Search images](#id26)
`GET /images/search`
: Search for an image in the docker index
**Example request**:
GET /images/search?term=sshd HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"Name":"cespare/sshd",
"Description":""
},
{
"Name":"johnfuller/sshd",
"Description":""
},
{
"Name":"dhrp/mongodb-sshd",
"Description":""
}
]
:query term: term to search
:statuscode 200: no error
:statuscode 500: server error
### [2.3 Misc](#id27)
#### [Build an image from Dockerfile via stdin](#id28)
`POST /build`
: Build an image from Dockerfile via stdin
**Example request**:
POST /build HTTP/1.1
{{ STREAM }}
**Example response**:
HTTP/1.1 200 OK
{{ STREAM }}
Query Parameters:
 
- **t** – repository name to be applied to the resulting image in
case of success
Status Codes:
- **200** – no error
- **500** – server error
#### [Get default username and email](#id29)
`GET /auth`
: Get the default username and email
**Example request**:
GET /auth HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/json
{
"username":"hannibal",
"email":"hannibal@a-team.com"
}
Status Codes:
- **200** – no error
- **500** – server error
#### [Check auth configuration and store it](#id30)
`POST /auth`
: Get the default username and email
**Example request**:
POST /auth HTTP/1.1
Content-Type: application/json
{
"username":"hannibal",
"password:"xxxx",
"email":"hannibal@a-team.com"
}
**Example response**:
HTTP/1.1 200 OK
Status Codes:
- **200** – no error
- **204** – no error
- **500** – server error
#### [Display system-wide information](#id31)
`GET /info`
: Display system-wide information
**Example request**:
GET /info HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/json
{
"Containers":11,
"Images":16,
"Debug":false,
"NFd": 11,
"NGoroutines":21,
"MemoryLimit":true,
"SwapLimit":false
}
Status Codes:
- **200** – no error
- **500** – server error
#### [Show the docker version information](#id32)
`GET /version`
: Show the docker version information
**Example request**:
GET /version HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/json
{
"Version":"0.2.2",
"GitCommit":"5a2a5cc+CHANGES",
"GoVersion":"go1.0.3"
}
Status Codes:
- **200** – no error
- **500** – server error
#### [Create a new image from a container’s changes](#id33)
`POST /commit`
: Create a new image from a container’s changes
>
> **Example request**:
POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1
Content-Type: application/json
{
"Cmd": ["cat", "/world"],
"PortSpecs":["22"]
}
**Example response**:
HTTP/1.1 201 OK
Content-Type: application/vnd.docker.raw-stream
{"Id":"596069db4bf5"}
Query Parameters:
 
- **container** – source container
- **repo** – repository
- **tag** – tag
- **m** – commit message
- **author** – author (eg. "John Hannibal Smith
\<[hannibal@a-team.com](mailto:hannibal%40a-team.com)\>")
Status Codes:
- **201** – no error
- **404** – no such container
- **500** – server error
## [3. Going further](#id34)
### [3.1 Inside ‘docker run’](#id35)
Here are the steps of ‘docker run’ :
- Create the container
- If the status code is 404, it means the image doesn’t exists:
: - Try to pull it
- Then retry to create the container
- Start the container
- If you are not in detached mode:
: - Attach to the container, using logs=1 (to have stdout and
stderr from the container’s start) and stream=1
- If in detached mode or only stdin is attached:
: - Display the container’s id
### [3.2 Hijacking](#id36)
In this first version of the API, some of the endpoints, like /attach,
/pull or /push uses hijacking to transport stdin, stdout and stderr on
the same socket. This might change in the future.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -7,8 +7,6 @@
docker.io Accounts API
======================
.. contents:: Table of Contents
1. Endpoints
============
@@ -7,8 +7,6 @@
docker.io OAuth API
===================
.. contents:: Table of Contents
1. Brief introduction
=====================
@@ -98,8 +98,6 @@ v1.8
Full Documentation
------------------
:doc:`docker_remote_api_v1.8`
What's new
----------
@@ -126,8 +124,6 @@ v1.7
Full Documentation
------------------
:doc:`docker_remote_api_v1.7`
What's new
----------
@@ -230,8 +226,6 @@ v1.6
Full Documentation
------------------
:doc:`docker_remote_api_v1.6`
What's new
----------
@@ -250,8 +244,6 @@ v1.5
Full Documentation
------------------
:doc:`docker_remote_api_v1.5`
What's new
----------
@@ -277,8 +269,6 @@ v1.4
Full Documentation
------------------
:doc:`docker_remote_api_v1.4`
What's new
----------
@@ -302,8 +292,6 @@ docker v0.5.0 51f6c4a_
Full Documentation
------------------
:doc:`docker_remote_api_v1.3`
What's new
----------
@@ -344,8 +332,6 @@ docker v0.4.2 2e7649b_
Full Documentation
------------------
:doc:`docker_remote_api_v1.2`
What's new
----------
@@ -379,8 +365,6 @@ docker v0.4.0 a8ae398_
Full Documentation
------------------
:doc:`docker_remote_api_v1.1`
What's new
----------
@@ -408,8 +392,6 @@ docker v0.3.4 8d73740_
Full Documentation
------------------
:doc:`docker_remote_api_v1.0`
What's new
----------
@@ -8,8 +8,6 @@
Docker Remote API v1.10
=======================
.. contents:: Table of Contents
1. Brief introduction
=====================
@@ -8,8 +8,6 @@
Docker Remote API v1.11
=======================
.. contents:: Table of Contents
1. Brief introduction
=====================
@@ -8,8 +8,6 @@
Docker Remote API v1.9
======================
.. contents:: Table of Contents
1. Brief introduction
=====================
+4 -9
View File
@@ -4,8 +4,8 @@
.. _cli:
Command Line Help
-----------------
Command Line
============
To list available commands, either run ``docker`` with no parameters or execute
``docker help``::
@@ -20,8 +20,8 @@ To list available commands, either run ``docker`` with no parameters or execute
.. _cli_options:
Options
-------
Option types
------------
Single character commandline options can be combined, so rather than typing
``docker run -t -i --name test busybox sh``, you can write
@@ -56,11 +56,6 @@ Options like ``--name=""`` expect a string, and they can only be
specified once. Options like ``-c=0`` expect an integer, and they can
only be specified once.
----
Commands
--------
.. _cli_daemon:
``daemon``
-3
View File
@@ -20,9 +20,6 @@ than any other ``docker`` command.
Every one of the :ref:`example_list` shows running containers, and so
here we try to give more in-depth guidance.
.. contents:: Table of Contents
:depth: 2
.. _run_running:
General Form
+2
View File
@@ -0,0 +1,2 @@
User-agent: *
Allow: /
-1
View File
@@ -10,7 +10,6 @@ This documentation has the following resources:
.. toctree::
:maxdepth: 1
Introduction <index>
installation/index
use/index
examples/index