Browse code

re-doing Docker Engine overview topics for v.1.12

fixed broken links created from Engine Overview update by adding missing topic to daemon reference page and updating the hrefs in the api pages

Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>

Victoria Bialas authored on 2016/06/08 09:42:00
Showing 11 changed files
1 1
new file mode 100644
2 2
Binary files /dev/null and b/docs/article-img/engine-components-flow.png differ
3 3
deleted file mode 100644
... ...
@@ -1,205 +0,0 @@
1
-<!--[metadata]>
2
-+++
3
-aliases = ["/engine/userguide/basics/"]
4
-title = "Quickstart"
5
-description = "Common usage and commands"
6
-keywords = ["Examples, Usage, basic commands, docker, documentation,  examples"]
7
-[menu.main]
8
-parent = "engine_use"
9
-weight=-90
10
-+++
11
-<![end-metadata]-->
12
-
13
-# Docker Engine Quickstart
14
-
15
-This quickstart assumes you have a working installation of Docker Engine. To verify Engine is installed and configured, use the following command:
16
-
17
-    # Check that you have a working install
18
-    $ docker info
19
-
20
-If you have a successful install, the system information appears. If you get `docker: command not found` or something like
21
-`/var/lib/docker/repositories: permission denied` you may have an
22
-incomplete Docker installation or insufficient privileges to access
23
-Engine on your machine. With the default installation of Engine `docker`
24
-commands need to be run by a user that is in the `docker` group or by the
25
-`root` user.
26
-
27
-Depending on your Engine system configuration, you may be required
28
-to preface each `docker` command with `sudo`. If you want to run without using
29
-`sudo` with the `docker` commands, then create a Unix group called `docker` and
30
-add the user to the 'docker' group.
31
-
32
-For more information about installing Docker Engine or `sudo` configuration, refer to
33
-the [installation](installation/index.md) instructions for your operating system.
34
-
35
-
36
-## Download a pre-built image
37
-
38
-To pull an `ubuntu` image, run:
39
-
40
-    # Download an ubuntu image
41
-    $ docker pull ubuntu
42
-
43
-This downloads the `ubuntu` image by name from [Docker Hub](https://hub.docker.com) to a local
44
-image cache. To search for an image, run `docker search`. For more information, go to:
45
-[Searching images](userguide/containers/dockerrepos.md#searching-for-images)
46
-
47
-
48
-> **Note**:
49
-> When the image is successfully downloaded, you see a 12 character
50
-> hash `539c0211cd76: Download complete` which is the
51
-> short form of the Image ID. These short Image IDs are the first 12
52
-> characters of the full Image ID. To view this information, run
53
-> `docker inspect` or `docker images --no-trunc=true`.
54
-
55
-To display a list of downloaded images, run `docker images`.
56
-
57
-## Running an interactive shell
58
-
59
-To run an interactive shell in the Ubuntu image:
60
-
61
-    $ docker run -i -t ubuntu /bin/bash       
62
-
63
-The `-i` flag starts an interactive container.
64
-The `-t` flag creates a pseudo-TTY that attaches `stdin` and `stdout`.  
65
-The image is `ubuntu`.
66
-The command `/bin/bash` starts a shell you can log in.
67
-
68
-To detach the `tty` without exiting the shell, use the escape sequence
69
-`Ctrl-p` + `Ctrl-q`. The container continues to exist in a stopped state
70
-once exited. To list all running containers, run `docker ps`. To view stopped and running containers,
71
-run `docker ps -a`.
72
-
73
-## Bind Docker to another host/port or a Unix socket
74
-
75
-> **Warning**:
76
-> Changing the default `docker` daemon binding to a
77
-> TCP port or Unix *docker* user group will increase your security risks
78
-> by allowing non-root users to gain *root* access on the host. Make sure
79
-> you control access to `docker`. If you are binding
80
-> to a TCP port, anyone with access to that port has full Docker access;
81
-> so it is not advisable on an open network.
82
-
83
-With `-H` it is possible to make the Docker daemon to listen on a
84
-specific IP and port. By default, it will listen on
85
-`unix:///var/run/docker.sock` to allow only local connections by the
86
-*root* user. You *could* set it to `0.0.0.0:2375` or a specific host IP
87
-to give access to everybody, but that is **not recommended** because
88
-then it is trivial for someone to gain root access to the host where the
89
-daemon is running.
90
-
91
-Similarly, the Docker client can use `-H` to connect to a custom port.
92
-The Docker client will default to connecting to `unix:///var/run/docker.sock`
93
-on Linux, and `tcp://127.0.0.1:2376` on Windows.
94
-
95
-`-H` accepts host and port assignment in the following format:
96
-
97
-    tcp://[host]:[port][path] or unix://path
98
-
99
-For example:
100
-
101
--   `tcp://` -> TCP connection to `127.0.0.1` on either port `2376` when TLS encryption
102
-    is on, or port `2375` when communication is in plain text.
103
--   `tcp://host:2375` -> TCP connection on
104
-    host:2375
105
--   `tcp://host:2375/path` -> TCP connection on
106
-    host:2375 and prepend path to all requests
107
--   `unix://path/to/socket` -> Unix socket located
108
-    at `path/to/socket`
109
-
110
-`-H`, when empty, will default to the same value as
111
-when no `-H` was passed in.
112
-
113
-`-H` also accepts short form for TCP bindings:
114
-
115
-    `host:` or `host:port` or `:port`
116
-
117
-Run Docker in daemon mode:
118
-
119
-    $ sudo <path to>/dockerd -H 0.0.0.0:5555 &
120
-
121
-Download an `ubuntu` image:
122
-
123
-    $ docker -H :5555 pull ubuntu
124
-
125
-You can use multiple `-H`, for example, if you want to listen on both
126
-TCP and a Unix socket
127
-
128
-    # Run docker in daemon mode
129
-    $ sudo <path to>/dockerd -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock &
130
-    # Download an ubuntu image, use default Unix socket
131
-    $ docker pull ubuntu
132
-    # OR use the TCP port
133
-    $ docker -H tcp://127.0.0.1:2375 pull ubuntu
134
-
135
-## Starting a long-running worker process
136
-
137
-    # Start a very useful long-running process
138
-    $ JOB=$(docker run -d ubuntu /bin/sh -c "while true; do echo Hello world; sleep 1; done")
139
-
140
-    # Collect the output of the job so far
141
-    $ docker logs $JOB
142
-
143
-    # Kill the job
144
-    $ docker kill $JOB
145
-
146
-## Listing containers
147
-
148
-    $ docker ps # Lists only running containers
149
-    $ docker ps -a # Lists all containers
150
-
151
-## Controlling containers
152
-
153
-    # Start a new container
154
-    $ JOB=$(docker run -d ubuntu /bin/sh -c "while true; do echo Hello world; sleep 1; done")
155
-
156
-    # Stop the container
157
-    $ docker stop $JOB
158
-
159
-    # Start the container
160
-    $ docker start $JOB
161
-
162
-    # Restart the container
163
-    $ docker restart $JOB
164
-
165
-    # SIGKILL a container
166
-    $ docker kill $JOB
167
-
168
-    # Remove a container
169
-    $ docker stop $JOB # Container must be stopped to remove it
170
-    $ docker rm $JOB
171
-
172
-## Bind a service on a TCP port
173
-
174
-    # Bind port 4444 of this container, and tell netcat to listen on it
175
-    $ JOB=$(docker run -d -p 4444 ubuntu:12.10 /bin/nc -l 4444)
176
-
177
-    # Which public port is NATed to my container?
178
-    $ PORT=$(docker port $JOB 4444 | awk -F: '{ print $2 }')
179
-
180
-    # Connect to the public port
181
-    $ echo hello world | nc 127.0.0.1 $PORT
182
-
183
-    # Verify that the network connection worked
184
-    $ echo "Daemon received: $(docker logs $JOB)"
185
-
186
-## Committing (saving) a container state
187
-
188
-To save the current state of a container as an image:
189
-
190
-    $ docker commit <container> <some_name>
191
-
192
-When you commit your container, Docker Engine only stores the diff (difference) between
193
-the source image and the current state of the container's image. To list images
194
-you already have, run:
195
-
196
-    # List your images
197
-    $ docker images
198
-
199
-You now have an image state from which you can create new instances.
200
-
201
-## Where to go next
202
-
203
-* Work your way through the [Docker Engine User Guide](userguide/index.md)
204
-* Read more about [Store Images on Docker Hub](userguide/containers/dockerrepos.md)
205
-* Review [Command Line](reference/commandline/cli.md)
... ...
@@ -15,7 +15,7 @@ weight = 3
15 15
 
16 16
  - The Remote API has replaced `rcli`.
17 17
  - The daemon listens on `unix:///var/run/docker.sock` but you can
18
-   [Bind Docker to another host/port or a Unix socket](../../quickstart.md#bind-docker-to-another-host-port-or-a-unix-socket).
18
+   [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
19 19
  - The API tends to be REST, but for some complex commands, like `attach`
20 20
    or `pull`, the HTTP connection is hijacked to transport `STDOUT`,
21 21
    `STDIN` and `STDERR`.
... ...
@@ -15,7 +15,7 @@ weight = 2
15 15
 
16 16
  - The Remote API has replaced `rcli`.
17 17
  - The daemon listens on `unix:///var/run/docker.sock` but you can
18
-   [Bind Docker to another host/port or a Unix socket](../../quickstart.md#bind-docker-to-another-host-port-or-a-unix-socket).
18
+   [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
19 19
  - The API tends to be REST. However, for some complex commands, like `attach`
20 20
    or `pull`, the HTTP connection is hijacked to transport `stdout`,
21 21
    `stdin` and `stderr`.
... ...
@@ -15,7 +15,7 @@ weight = 1
15 15
 
16 16
  - The Remote API has replaced `rcli`.
17 17
  - The daemon listens on `unix:///var/run/docker.sock` but you can
18
-   [Bind Docker to another host/port or a Unix socket](../../quickstart.md#bind-docker-to-another-host-port-or-a-unix-socket).
18
+   [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
19 19
  - The API tends to be REST. However, for some complex commands, like `attach`
20 20
    or `pull`, the HTTP connection is hijacked to transport `stdout`,
21 21
    `stdin` and `stderr`.
... ...
@@ -1362,12 +1362,12 @@ or being killed.
1362 1362
 
1363 1363
 Query Parameters:
1364 1364
 
1365
--   **dockerfile** - Path within the build context to the Dockerfile. This is 
1365
+-   **dockerfile** - Path within the build context to the Dockerfile. This is
1366 1366
         ignored if `remote` is specified and points to an individual filename.
1367 1367
 -   **t** – A repository name (and optionally a tag) to apply to
1368 1368
         the resulting image in case of success.
1369
--   **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the 
1370
-        URI specifies a filename, the file's contents are placed into a file 
1369
+-   **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the
1370
+        URI specifies a filename, the file's contents are placed into a file
1371 1371
 		called `Dockerfile`.
1372 1372
 -   **q** – Suppress verbose build output.
1373 1373
 -   **nocache** – Do not use the cache when building the image.
... ...
@@ -2338,7 +2338,7 @@ from **200 OK** to **101 UPGRADED** and resends the same headers.
2338 2338
 
2339 2339
 ## 3.3 CORS Requests
2340 2340
 
2341
-To set cross origin requests to the remote api please give values to 
2341
+To set cross origin requests to the remote api please give values to
2342 2342
 `--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all,
2343 2343
 default or blank means CORS disabled
2344 2344
 
... ...
@@ -15,7 +15,7 @@ weight=-2
15 15
 
16 16
  - The Remote API has replaced `rcli`.
17 17
  - The daemon listens on `unix:///var/run/docker.sock` but you can
18
-   [Bind Docker to another host/port or a Unix socket](../../quickstart.md#bind-docker-to-another-host-port-or-a-unix-socket).
18
+   [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
19 19
  - The API tends to be REST. However, for some complex commands, like `attach`
20 20
    or `pull`, the HTTP connection is hijacked to transport `stdout`,
21 21
    `stdin` and `stderr`.
... ...
@@ -15,7 +15,7 @@ weight=-3
15 15
 
16 16
  - The Remote API has replaced `rcli`.
17 17
  - The daemon listens on `unix:///var/run/docker.sock` but you can
18
-   [Bind Docker to another host/port or a Unix socket](../../quickstart.md#bind-docker-to-another-host-port-or-a-unix-socket).
18
+   [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
19 19
  - The API tends to be REST. However, for some complex commands, like `attach`
20 20
    or `pull`, the HTTP connection is hijacked to transport `stdout`,
21 21
    `stdin` and `stderr`.
... ...
@@ -15,7 +15,7 @@ weight=-4
15 15
 
16 16
  - The Remote API has replaced `rcli`.
17 17
  - The daemon listens on `unix:///var/run/docker.sock` but you can
18
-   [Bind Docker to another host/port or a Unix socket](../../quickstart.md#bind-docker-to-another-host-port-or-a-unix-socket).
18
+   [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
19 19
  - The API tends to be REST. However, for some complex commands, like `attach`
20 20
    or `pull`, the HTTP connection is hijacked to transport `stdout`,
21 21
    `stdin` and `stderr`.
... ...
@@ -15,7 +15,7 @@ weight=-5
15 15
 
16 16
  - The Remote API has replaced `rcli`.
17 17
  - The daemon listens on `unix:///var/run/docker.sock` but you can
18
-   [Bind Docker to another host/port or a Unix socket](../../quickstart.md#bind-docker-to-another-host-port-or-a-unix-socket).
18
+   [Bind Docker to another host/port or a Unix socket](../commandline/dockerd.md#bind-docker-to-another-host-port-or-a-unix-socket).
19 19
  - The API tends to be REST. However, for some complex commands, like `attach`
20 20
    or `pull`, the HTTP connection is hijacked to transport `stdout`,
21 21
    `stdin` and `stderr`.
... ...
@@ -139,6 +139,68 @@ The Docker client will honor the `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY`
139 139
 environment variables (or the lowercase versions thereof). `HTTPS_PROXY` takes
140 140
 precedence over `HTTP_PROXY`.
141 141
 
142
+### Bind Docker to another host/port or a Unix socket
143
+
144
+> **Warning**:
145
+> Changing the default `docker` daemon binding to a
146
+> TCP port or Unix *docker* user group will increase your security risks
147
+> by allowing non-root users to gain *root* access on the host. Make sure
148
+> you control access to `docker`. If you are binding
149
+> to a TCP port, anyone with access to that port has full Docker access;
150
+> so it is not advisable on an open network.
151
+
152
+With `-H` it is possible to make the Docker daemon to listen on a
153
+specific IP and port. By default, it will listen on
154
+`unix:///var/run/docker.sock` to allow only local connections by the
155
+*root* user. You *could* set it to `0.0.0.0:2375` or a specific host IP
156
+to give access to everybody, but that is **not recommended** because
157
+then it is trivial for someone to gain root access to the host where the
158
+daemon is running.
159
+
160
+Similarly, the Docker client can use `-H` to connect to a custom port.
161
+The Docker client will default to connecting to `unix:///var/run/docker.sock`
162
+on Linux, and `tcp://127.0.0.1:2376` on Windows.
163
+
164
+`-H` accepts host and port assignment in the following format:
165
+
166
+    tcp://[host]:[port][path] or unix://path
167
+
168
+For example:
169
+
170
+-   `tcp://` -> TCP connection to `127.0.0.1` on either port `2376` when TLS encryption
171
+    is on, or port `2375` when communication is in plain text.
172
+-   `tcp://host:2375` -> TCP connection on
173
+    host:2375
174
+-   `tcp://host:2375/path` -> TCP connection on
175
+    host:2375 and prepend path to all requests
176
+-   `unix://path/to/socket` -> Unix socket located
177
+    at `path/to/socket`
178
+
179
+`-H`, when empty, will default to the same value as
180
+when no `-H` was passed in.
181
+
182
+`-H` also accepts short form for TCP bindings:
183
+
184
+    `host:` or `host:port` or `:port`
185
+
186
+Run Docker in daemon mode:
187
+
188
+    $ sudo <path to>/dockerd -H 0.0.0.0:5555 &
189
+
190
+Download an `ubuntu` image:
191
+
192
+    $ docker -H :5555 pull ubuntu
193
+
194
+You can use multiple `-H`, for example, if you want to listen on both
195
+TCP and a Unix socket
196
+
197
+    # Run docker in daemon mode
198
+    $ sudo <path to>/dockerd -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock &
199
+    # Download an ubuntu image, use default Unix socket
200
+    $ docker pull ubuntu
201
+    # OR use the TCP port
202
+    $ docker -H tcp://127.0.0.1:2375 pull ubuntu
203
+
142 204
 ### Daemon storage-driver option
143 205
 
144 206
 The Docker daemon has support for several different image layer storage
... ...
@@ -529,7 +591,7 @@ can specify default container isolation technology with this, for example:
529 529
 
530 530
 Will make `hyperv` the default isolation technology on Windows. If no isolation
531 531
 value is specified on daemon start, on Windows client, the default is
532
-`hyperv`, and on Windows server, the default is `process`. 
532
+`hyperv`, and on Windows server, the default is `process`.
533 533
 
534 534
 ## Daemon DNS options
535 535
 
... ...
@@ -1,16 +1,20 @@
1 1
 <!--[metadata]>
2 2
 +++
3
-aliases = ["/introduction/understanding-docker/"]
4
-title = "Understand the architecture"
3
+aliases = [
4
+"/introduction/understanding-docker/",
5
+"/engine/userguide/basics/",
6
+"/engine/quickstart.md"
7
+]
8
+title = "Docker Overview"
5 9
 description = "Docker explained in depth"
6 10
 keywords = ["docker, introduction, documentation, about, technology,  understanding"]
7 11
 [menu.main]
8 12
 parent = "engine_use"
9
-weight = -82
13
+weight = -90
10 14
 +++
11 15
 <![end-metadata]-->
12 16
 
13
-# Understand the architecture
17
+# Docker Overview
14 18
 
15 19
 Docker is an open platform for developing, shipping, and running applications.
16 20
 Docker is designed to deliver your applications faster. With Docker you can
... ...
@@ -22,6 +26,8 @@ running code.
22 22
 Docker does this by combining kernel containerization features with workflows
23 23
 and tooling that help you manage and deploy your applications.
24 24
 
25
+## What is the Docker platform?
26
+
25 27
 At its core, Docker provides a way to run almost any application securely
26 28
 isolated in a container. The isolation and security allow you to run many
27 29
 containers simultaneously on your host. The lightweight nature of containers,
... ...
@@ -37,6 +43,24 @@ and testing
37 37
 * Deploy those applications to your production environment,
38 38
  whether it is in a local data center or the Cloud
39 39
 
40
+## What is Docker Engine?
41
+
42
+Docker Engine is a client-server application with these major components:
43
+
44
+* A server which is a type of long-running program called a daemon process.
45
+
46
+* A REST API which specifies interfaces that programs can use to talk to the daemon and instruct it what to do.
47
+
48
+* A command line interface (CLI) client.
49
+
50
+![Docker Engine Components Flow](article-img/engine-components-flow.png)
51
+
52
+The CLI imakes use of the Docker REST API to control or interact with the Docker daemon through scripting or direct CLI commands. Many other Docker applications make use of the underlying API and CLI.
53
+
54
+The daemon creates and manages Docker objects.  Docker objects include images, containers, networks, data volumes, and so forth.
55
+
56
+> **Note:** Docker is licensed under the open source Apache 2.0 license.
57
+
40 58
 ## What can I use Docker for?
41 59
 
42 60
 *Faster delivery of your applications*
... ...
@@ -70,17 +94,6 @@ environments: for example, building your own Cloud or Platform-as-a-Service. But
70 70
 it is also useful for small and medium deployments where you want to get more
71 71
 out of the resources you have.
72 72
 
73
-## What are the major Docker components?
74
-Docker has two major components:
75
-
76
-
77
-* Docker Engine: the open source containerization platform.
78
-* [Docker Hub](https://hub.docker.com): our Software-as-a-Service
79
-  platform for sharing and managing Docker containers.
80
-
81
-
82
-> **Note:** Docker is licensed under the open source Apache 2.0 license.
83
-
84 73
 ## What is Docker's architecture?
85 74
 Docker uses a client-server architecture. The Docker *client* talks to the
86 75
 Docker *daemon*, which does the heavy lifting of building, running, and