rebase master
Upstream-commit: 3b5ad44647bf4033502594a4048bffea656b2a08 Component: engine
@@ -19,13 +19,38 @@ Docker Remote API
|
||||
2. Versions
|
||||
===========
|
||||
|
||||
The current verson of the API is 1.2
|
||||
Calling /images/<name>/insert is the same as calling /v1.2/images/<name>/insert
|
||||
The current verson of the API is 1.3
|
||||
Calling /images/<name>/insert is the same as calling /v1.3/images/<name>/insert
|
||||
You can still call an old version of the api using /v1.0/images/<name>/insert
|
||||
|
||||
:doc:`docker_remote_api_v1.3`
|
||||
*****************************
|
||||
|
||||
What's new
|
||||
----------
|
||||
|
||||
Builder (/build):
|
||||
|
||||
- Simplify the upload of the build context
|
||||
- Simply stream a tarball instead of multipart upload with 4 intermediary buffers
|
||||
- Simpler, less memory usage, less disk usage and faster
|
||||
|
||||
.. Note::
|
||||
The /build improvements are not reverse-compatible. Pre 1.3 clients will break on /build.
|
||||
|
||||
List containers (/containers/json):
|
||||
|
||||
- You can use size=1 to get the size of the containers
|
||||
|
||||
Start containers (/containers/<id>/start):
|
||||
|
||||
- You can now pass host-specific configuration (e.g. bind mounts) in the POST body for start calls
|
||||
|
||||
:doc:`docker_remote_api_v1.2`
|
||||
*****************************
|
||||
|
||||
docker v0.4.2 2e7649b_
|
||||
|
||||
What's new
|
||||
----------
|
||||
|
||||
@@ -65,6 +90,9 @@ Uses json stream instead of HTML hijack, it looks like this:
|
||||
...
|
||||
|
||||
|
||||
:doc:`docker_remote_api_v1.0`
|
||||
*****************************
|
||||
|
||||
docker v0.3.4 8d73740_
|
||||
|
||||
What's new
|
||||
@@ -75,6 +103,7 @@ Initial version
|
||||
|
||||
.. _a8ae398: https://github.com/dotcloud/docker/commit/a8ae398bf52e97148ee7bd0d5868de2e15bd297f
|
||||
.. _8d73740: https://github.com/dotcloud/docker/commit/8d73740343778651c09160cde9661f5f387b36f4
|
||||
.. _2e7649b: https://github.com/dotcloud/docker/commit/2e7649beda7c820793bd46766cbc2cfeace7b168
|
||||
|
||||
==================================
|
||||
Docker Remote API Client Libraries
|
||||
@@ -94,6 +123,8 @@ and we will add the libraries here.
|
||||
+----------------------+----------------+--------------------------------------------+
|
||||
| Ruby | docker-client | https://github.com/geku/docker-client |
|
||||
+----------------------+----------------+--------------------------------------------+
|
||||
| Ruby | docker-api | https://github.com/swipely/docker-api |
|
||||
+----------------------+----------------+--------------------------------------------+
|
||||
| Javascript | docker-js | https://github.com/dgoujard/docker-js |
|
||||
+----------------------+----------------+--------------------------------------------+
|
||||
| Javascript (Angular) | dockerui | https://github.com/crosbymichael/dockerui |
|
||||
|
||||
@@ -847,7 +847,7 @@ Build an image from Dockerfile via stdin
|
||||
|
||||
.. http:post:: /build
|
||||
|
||||
Build an image from Dockerfile via stdin
|
||||
Build an image from Dockerfile
|
||||
|
||||
**Example request**:
|
||||
|
||||
@@ -866,9 +866,12 @@ Build an image from Dockerfile via stdin
|
||||
{{ STREAM }}
|
||||
|
||||
:query t: tag to be applied to the resulting image in case of success
|
||||
:query remote: resource to fetch, as URI
|
||||
:statuscode 200: no error
|
||||
:statuscode 500: server error
|
||||
|
||||
{{ STREAM }} is the raw text output of the build command. It uses the HTTP Hijack method in order to stream.
|
||||
|
||||
|
||||
Check auth configuration
|
||||
************************
|
||||
|
||||
@@ -8,9 +8,11 @@
|
||||
|
||||
::
|
||||
|
||||
Usage: docker build [OPTIONS] PATH | -
|
||||
Usage: docker build [OPTIONS] PATH | URL | -
|
||||
Build a new container image from the source code at PATH
|
||||
-t="": Tag to be applied to the resulting image in case of success.
|
||||
When a single Dockerfile is given as URL, then no context is set. When a git repository is set as URL, the repository is used as context
|
||||
|
||||
|
||||
Examples
|
||||
--------
|
||||
@@ -27,7 +29,15 @@ Examples
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker build -
|
||||
docker build - < Dockerfile
|
||||
|
||||
| This will read a Dockerfile from Stdin without context. Due to the lack of a context, no contents of any local directory will be sent to the docker daemon.
|
||||
| ADD doesn't work when running in this mode due to the absence of the context, thus having no source files to copy to the container.
|
||||
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker build github.com/creack/docker-firefox
|
||||
|
||||
| This will clone the github repository and use it as context. The Dockerfile at the root of the repository is used as Dockerfile.
|
||||
| Note that you can specify an arbitrary git repository by using the 'git://' schema.
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
::
|
||||
|
||||
Usage: docker run [OPTIONS] IMAGE COMMAND [ARG...]
|
||||
Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
|
||||
|
||||
Run a command in a new container
|
||||
|
||||
@@ -25,3 +25,4 @@
|
||||
-d=[]: Set custom dns servers for the container
|
||||
-v=[]: Creates a new volume and mounts it at the specified path.
|
||||
-volumes-from="": Mount all volumes from the given container.
|
||||
-b=[]: Create a bind mount with: [host-dir]:[container-dir]:[rw|ro]
|
||||
|
||||
@@ -30,6 +30,7 @@ import sys, os
|
||||
html_additional_pages = {
|
||||
'concepts/containers': 'redirect_home.html',
|
||||
'concepts/introduction': 'redirect_home.html',
|
||||
'builder/basics': 'redirect_build.html',
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
:title: Image & Container
|
||||
:description: Definitions of an image and container
|
||||
:keywords: containers, lxc, concepts, explanation, image, container
|
||||
|
||||
File Systems
|
||||
============
|
||||
|
||||
.. image:: images/docker-filesystems-generic.png
|
||||
|
||||
In order for a Linux system to run, it typically needs two `file
|
||||
systems <http://en.wikipedia.org/wiki/Filesystem>`_:
|
||||
|
||||
1. boot file system (bootfs)
|
||||
2. root file system (rootfs)
|
||||
|
||||
The **boot file system** contains the bootloader and the kernel. The
|
||||
user never makes any changes to the boot file system. In fact, soon
|
||||
after the boot process is complete, the entire kernel is in memory,
|
||||
and the boot file system is unmounted to free up the RAM associated
|
||||
with the initrd disk image.
|
||||
|
||||
The **root file system** includes the typical directory structure we
|
||||
associate with Unix-like operating systems: ``/dev, /proc, /bin, /etc,
|
||||
/lib, /usr,`` and ``/tmp`` plus all the configuration files, binaries
|
||||
and libraries required to run user applications (like bash, ls, and so
|
||||
forth).
|
||||
|
||||
While there can be important kernal differences between different
|
||||
Linux distributions, the contents and organization of the root file
|
||||
system are usually what make your software packages dependent on one
|
||||
distribution versus another. Docker can help solve this problem by
|
||||
running multiple distributions at the same time.
|
||||
|
||||
.. image:: images/docker-filesystems-multiroot.png
|
||||
|
||||
Layers and Union Mounts
|
||||
=======================
|
||||
|
||||
In a traditional Linux boot, the kernel first mounts the root file
|
||||
system as read-only, checks its integrity, and then switches the whole
|
||||
rootfs volume to read-write mode. Docker does something similar,
|
||||
*except* that instead of changing the file system to read-write mode,
|
||||
it takes advantage of a `union mount
|
||||
<http://en.wikipedia.org/wiki/Union_mount>`_ to add a read-write file
|
||||
system *over* the read-only file system. In fact there may be multiple
|
||||
read-only file systems stacked on top of each other.
|
||||
|
||||
.. image:: images/docker-filesystems-multilayer.png
|
||||
|
||||
At first, the top layer has nothing in it, but any time a process
|
||||
creates a file, this happens in the top layer. And if something needs
|
||||
to update an existing file in a lower layer, then the file gets copied
|
||||
to the upper layer and changes go into the copy. The version of the
|
||||
file on the lower layer cannot be seen by the applications anymore,
|
||||
but it is there, unchanged.
|
||||
|
||||
We call the union of the read-write layer and all the read-only layers
|
||||
a **union file system**.
|
||||
|
||||
Image
|
||||
=====
|
||||
|
||||
In Docker terminology, a read-only layer is called an **image**. An
|
||||
image never changes. Because Docker uses a union file system, the
|
||||
applications think the whole file system is mounted read-write,
|
||||
because any file can be changed. But all the changes go to the
|
||||
top-most layer, and underneath, the image is unchanged. Since they
|
||||
don't change, images do not have state.
|
||||
|
||||
Each image may depend on one more image which forms the layer beneath
|
||||
it. We sometimes say that the lower image is the **parent** of the
|
||||
upper image.
|
||||
|
||||
Base Image
|
||||
==========
|
||||
|
||||
An image that has no parent is a **base image**.
|
||||
|
||||
Container
|
||||
=========
|
||||
|
||||
Once you start a process in Docker from an image, Docker fetches the
|
||||
image and its parent, and repeats the process until it reaches the
|
||||
base image. Then the union file system adds a read-write layer on
|
||||
top. That read-write layer, plus the information about its parent and
|
||||
some additional information like its unique id, is called a
|
||||
**container**.
|
||||
|
||||
Containers can change, and so they have state. A container may be
|
||||
running or exited. In either case, the state of the file system and
|
||||
its exit value is preserved. You can start, stop, and restart a
|
||||
container. The processes restart from scratch (their memory state is
|
||||
**not** preserved in a container), but the file system is just as it
|
||||
was when the container was stopped.
|
||||
|
||||
You can promote a container to an image with ``docker commit``. Once a
|
||||
container is an image, you can use it as a parent for new containers.
|
||||
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 243 KiB |
@@ -0,0 +1,18 @@
|
||||
:title: Terms
|
||||
:description: Definitions of terms used in Docker documentation
|
||||
:keywords: concepts, documentation, docker, containers
|
||||
|
||||
|
||||
|
||||
Terms
|
||||
=====
|
||||
|
||||
Definitions of terms used in Docker documentation.
|
||||
|
||||
Contents:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
fundamentals
|
||||
|
||||
@@ -18,5 +18,6 @@ This documentation has the following resources:
|
||||
contributing/index
|
||||
api/index
|
||||
faq
|
||||
terms/index
|
||||
|
||||
.. image:: concepts/images/lego_docker.jpg
|
||||
|
||||
@@ -121,19 +121,7 @@ functionally equivalent to prefixing the command with `<key>=<value>`
|
||||
.. note::
|
||||
The environment variables will persist when a container is run from the resulting image.
|
||||
|
||||
2.7 INSERT
|
||||
----------
|
||||
|
||||
``INSERT <file url> <path>``
|
||||
|
||||
The `INSERT` instruction will download the file from the given url to the given
|
||||
path within the image. It is similar to `RUN curl -o <path> <url>`, assuming
|
||||
curl was installed within the image.
|
||||
|
||||
.. note::
|
||||
The path must include the file name.
|
||||
|
||||
2.8 ADD
|
||||
2.7 ADD
|
||||
-------
|
||||
|
||||
``ADD <src> <dest>``
|
||||
@@ -141,7 +129,7 @@ curl was installed within the image.
|
||||
The `ADD` instruction will copy new files from <src> and add them to the container's filesystem at path `<dest>`.
|
||||
|
||||
`<src>` must be the path to a file or directory relative to the source directory being built (also called the
|
||||
context of the build).
|
||||
context of the build) or a remote file URL.
|
||||
|
||||
`<dest>` is the path at which the source will be copied in the destination container.
|
||||
|
||||
@@ -182,7 +170,6 @@ files and directories are created with mode 0700, uid and gid 0.
|
||||
RUN apt-get update
|
||||
|
||||
RUN apt-get install -y inotify-tools nginx apache2 openssh-server
|
||||
INSERT https://raw.github.com/creack/docker-vps/master/nginx-wrapper.sh /usr/sbin/nginx-wrapper
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
||||
@@ -40,8 +40,11 @@
|
||||
|
||||
{%- set script_files = script_files + ['_static/js/docs.js'] %}
|
||||
|
||||
{%- if pagename == 'index' %}
|
||||
<link rel="canonical" href="http://docs.docker.io/en/latest/">
|
||||
{% else %}
|
||||
<link rel="canonical" href="http://docs.docker.io/en/latest/{{ pagename }}/">
|
||||
|
||||
{% endif %}
|
||||
{%- for cssfile in css_files %}
|
||||
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
|
||||
{%- endfor %}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Page Moved</title>
|
||||
<meta http-equiv="refresh" content="0; url=http://docs.docker.io/en/latest/use/builder/">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
This page has moved. Perhaps you should visit the <a href="http://docs.docker.io/en/latest/use/builder/" title="builder page">Builder page</a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Page Moved</title>
|
||||
<meta http-equiv="refresh" content="0; url=http://docks.docker.io/en/latest/">
|
||||
<meta http-equiv="refresh" content="0; url=http://docs.docker.io/en/latest/">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||