Signed-off-by: Kara Alexandra <kalexandra@us.ibm.com>
(cherry picked from commit d0737e9ac0bfcbac0e212d157ab305e561eea3ee)
Signed-off-by: Tibor Vass <tibor@docker.com>
| ... | ... |
@@ -37,6 +37,7 @@ Let's start with listing the images you have locally on our host. You can |
| 37 | 37 |
do this using the `docker images` command like so: |
| 38 | 38 |
|
| 39 | 39 |
$ docker images |
| 40 |
+ |
|
| 40 | 41 |
REPOSITORY TAG IMAGE ID CREATED SIZE |
| 41 | 42 |
ubuntu 14.04 1d073211c498 3 days ago 187.9 MB |
| 42 | 43 |
busybox latest 2c5ac3f849df 5 days ago 1.113 MB |
| ... | ... |
@@ -87,6 +88,7 @@ can download it using the `docker pull` command. Suppose you'd like to |
| 87 | 87 |
download the `centos` image. |
| 88 | 88 |
|
| 89 | 89 |
$ docker pull centos |
| 90 |
+ |
|
| 90 | 91 |
Pulling repository centos |
| 91 | 92 |
b7de3133ff98: Pulling dependent layers |
| 92 | 93 |
5cc9e91966f7: Pulling fs layer |
| ... | ... |
@@ -101,6 +103,7 @@ can run a container from this image and you won't have to wait to |
| 101 | 101 |
download the image. |
| 102 | 102 |
|
| 103 | 103 |
$ docker run -t -i centos /bin/bash |
| 104 |
+ |
|
| 104 | 105 |
bash-4.1# |
| 105 | 106 |
|
| 106 | 107 |
## Finding images |
| ... | ... |
@@ -158,6 +161,7 @@ You've identified a suitable image, `training/sinatra`, and now you can download |
| 158 | 158 |
The team can now use this image by running their own containers. |
| 159 | 159 |
|
| 160 | 160 |
$ docker run -t -i training/sinatra /bin/bash |
| 161 |
+ |
|
| 161 | 162 |
root@a8cb6ce02d85:/# |
| 162 | 163 |
|
| 163 | 164 |
## Creating our own images |
| ... | ... |
@@ -176,6 +180,7 @@ To update an image you first need to create a container from the image |
| 176 | 176 |
you'd like to update. |
| 177 | 177 |
|
| 178 | 178 |
$ docker run -t -i training/sinatra /bin/bash |
| 179 |
+ |
|
| 179 | 180 |
root@0b2616b0e5a8:/# |
| 180 | 181 |
|
| 181 | 182 |
> **Note:** |
| ... | ... |
@@ -195,6 +200,7 @@ command. |
| 195 | 195 |
|
| 196 | 196 |
$ docker commit -m "Added json gem" -a "Kate Smith" \ |
| 197 | 197 |
0b2616b0e5a8 ouruser/sinatra:v2 |
| 198 |
+ |
|
| 198 | 199 |
4f177bd27a9ff0f6dc2a830403925b5360bfe0b93d476f7fc3231110e7f71b1c |
| 199 | 200 |
|
| 200 | 201 |
Here you've used the `docker commit` command. You've specified two flags: `-m` |
| ... | ... |
@@ -217,6 +223,7 @@ You can then look at our new `ouruser/sinatra` image using the `docker images` |
| 217 | 217 |
command. |
| 218 | 218 |
|
| 219 | 219 |
$ docker images |
| 220 |
+ |
|
| 220 | 221 |
REPOSITORY TAG IMAGE ID CREATED SIZE |
| 221 | 222 |
training/sinatra latest 5bc342fa0b91 10 hours ago 446.7 MB |
| 222 | 223 |
ouruser/sinatra v2 3c59e02ddd1a 10 hours ago 446.7 MB |
| ... | ... |
@@ -225,6 +232,7 @@ command. |
| 225 | 225 |
To use our new image to create a container you can then: |
| 226 | 226 |
|
| 227 | 227 |
$ docker run -t -i ouruser/sinatra:v2 /bin/bash |
| 228 |
+ |
|
| 228 | 229 |
root@78e82f680994:/# |
| 229 | 230 |
|
| 230 | 231 |
### Building an image from a `Dockerfile` |
| ... | ... |
@@ -240,7 +248,9 @@ tell Docker how to build our image. |
| 240 | 240 |
First, create a directory and a `Dockerfile`. |
| 241 | 241 |
|
| 242 | 242 |
$ mkdir sinatra |
| 243 |
+ |
|
| 243 | 244 |
$ cd sinatra |
| 245 |
+ |
|
| 244 | 246 |
$ touch Dockerfile |
| 245 | 247 |
|
| 246 | 248 |
If you are using Docker Machine on Windows, you may access your host |
| ... | ... |
@@ -275,6 +285,7 @@ Sinatra gem. |
| 275 | 275 |
Now let's take our `Dockerfile` and use the `docker build` command to build an image. |
| 276 | 276 |
|
| 277 | 277 |
$ docker build -t ouruser/sinatra:v2 . |
| 278 |
+ |
|
| 278 | 279 |
Sending build context to Docker daemon 2.048 kB |
| 279 | 280 |
Sending build context to Docker daemon |
| 280 | 281 |
Step 1 : FROM ubuntu:14.04 |
| ... | ... |
@@ -469,6 +480,7 @@ containers will get removed to clean things up. |
| 469 | 469 |
You can then create a container from our new image. |
| 470 | 470 |
|
| 471 | 471 |
$ docker run -t -i ouruser/sinatra:v2 /bin/bash |
| 472 |
+ |
|
| 472 | 473 |
root@8196968dac35:/# |
| 473 | 474 |
|
| 474 | 475 |
> **Note:** |
| ... | ... |
@@ -495,6 +507,7 @@ user name, the repository name and the new tag. |
| 495 | 495 |
Now, see your new tag using the `docker images` command. |
| 496 | 496 |
|
| 497 | 497 |
$ docker images ouruser/sinatra |
| 498 |
+ |
|
| 498 | 499 |
REPOSITORY TAG IMAGE ID CREATED SIZE |
| 499 | 500 |
ouruser/sinatra latest 5db5f8471261 11 hours ago 446.7 MB |
| 500 | 501 |
ouruser/sinatra devel 5db5f8471261 11 hours ago 446.7 MB |
| ... | ... |
@@ -508,6 +521,7 @@ unchanged, the digest value is predictable. To list image digest values, use |
| 508 | 508 |
the `--digests` flag: |
| 509 | 509 |
|
| 510 | 510 |
$ docker images --digests | head |
| 511 |
+ |
|
| 511 | 512 |
REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE |
| 512 | 513 |
ouruser/sinatra latest sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf 5db5f8471261 11 hours ago 446.7 MB |
| 513 | 514 |
|
| ... | ... |
@@ -527,6 +541,7 @@ allows you to share it with others, either publicly, or push it into [a |
| 527 | 527 |
private repository](https://hub.docker.com/account/billing-plans/). |
| 528 | 528 |
|
| 529 | 529 |
$ docker push ouruser/sinatra |
| 530 |
+ |
|
| 530 | 531 |
The push refers to a repository [ouruser/sinatra] (len: 1) |
| 531 | 532 |
Sending image list |
| 532 | 533 |
Pushing repository ouruser/sinatra (3 tags) |
| ... | ... |
@@ -540,6 +555,7 @@ containers](usingdocker.md) using the `docker rmi` command. |
| 540 | 540 |
Delete the `training/sinatra` image as you don't need it anymore. |
| 541 | 541 |
|
| 542 | 542 |
$ docker rmi training/sinatra |
| 543 |
+ |
|
| 543 | 544 |
Untagged: training/sinatra:latest |
| 544 | 545 |
Deleted: 5bc342fa0b91cabf65246837015197eecfa24b2213ed6a51a8974ae250fedd8d |
| 545 | 546 |
Deleted: ed0fffdcdae5eb2c3a55549857a8be7fc8bc4241fb19ad714364cbfd7a56b22f |
| ... | ... |
@@ -30,6 +30,7 @@ Running an application inside a container takes a single command: `docker run`. |
| 30 | 30 |
Let's run a hello world container. |
| 31 | 31 |
|
| 32 | 32 |
$ docker run ubuntu /bin/echo 'Hello world' |
| 33 |
+ |
|
| 33 | 34 |
Hello world |
| 34 | 35 |
|
| 35 | 36 |
You just launched your first container! |
| ... | ... |
@@ -59,6 +60,7 @@ the container stops once the command is executed. |
| 59 | 59 |
Let's specify a new command to run in the container. |
| 60 | 60 |
|
| 61 | 61 |
$ docker run -t -i ubuntu /bin/bash |
| 62 |
+ |
|
| 62 | 63 |
root@af8bae53bdd3:/# |
| 63 | 64 |
|
| 64 | 65 |
In this example: |
| ... | ... |
@@ -78,8 +80,11 @@ command prompt inside it: |
| 78 | 78 |
Let's try running some commands inside the container: |
| 79 | 79 |
|
| 80 | 80 |
root@af8bae53bdd3:/# pwd |
| 81 |
+ |
|
| 81 | 82 |
/ |
| 83 |
+ |
|
| 82 | 84 |
root@af8bae53bdd3:/# ls |
| 85 |
+ |
|
| 83 | 86 |
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var |
| 84 | 87 |
|
| 85 | 88 |
In this example: |
| ... | ... |
@@ -100,6 +105,7 @@ finished, the container stops. |
| 100 | 100 |
Let's create a container that runs as a daemon. |
| 101 | 101 |
|
| 102 | 102 |
$ docker run -d ubuntu /bin/sh -c "while true; do echo hello world; sleep 1; done" |
| 103 |
+ |
|
| 103 | 104 |
1e5535038e285177d5214659a068137486f96ee5c2e85a4ac52dc83f2ebe4147 |
| 104 | 105 |
|
| 105 | 106 |
In this example: |
| ... | ... |
@@ -132,6 +138,7 @@ The `docker ps` command queries the Docker daemon for information about all the |
| 132 | 132 |
about. |
| 133 | 133 |
|
| 134 | 134 |
$ docker ps |
| 135 |
+ |
|
| 135 | 136 |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| 136 | 137 |
1e5535038e28 ubuntu /bin/sh -c 'while tr 2 minutes ago Up 1 minute insane_babbage |
| 137 | 138 |
|
| ... | ... |
@@ -154,6 +161,7 @@ command. |
| 154 | 154 |
Let's use the container name `insane_babbage`. |
| 155 | 155 |
|
| 156 | 156 |
$ docker logs insane_babbage |
| 157 |
+ |
|
| 157 | 158 |
hello world |
| 158 | 159 |
hello world |
| 159 | 160 |
hello world |
| ... | ... |
@@ -169,6 +177,7 @@ Dockerized application! |
| 169 | 169 |
Next, run the `docker stop` command to stop our detached container. |
| 170 | 170 |
|
| 171 | 171 |
$ docker stop insane_babbage |
| 172 |
+ |
|
| 172 | 173 |
insane_babbage |
| 173 | 174 |
|
| 174 | 175 |
The `docker stop` command tells Docker to politely stop the running |
| ... | ... |
@@ -177,6 +186,7 @@ container and returns the name of the container it stopped. |
| 177 | 177 |
Let's check it worked with the `docker ps` command. |
| 178 | 178 |
|
| 179 | 179 |
$ docker ps |
| 180 |
+ |
|
| 180 | 181 |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| 181 | 182 |
|
| 182 | 183 |
Excellent. Our container is stopped. |
| ... | ... |
@@ -57,6 +57,7 @@ interface or by using the command line interface. Searching can find images by i |
| 57 | 57 |
name, user name, or description: |
| 58 | 58 |
|
| 59 | 59 |
$ docker search centos |
| 60 |
+ |
|
| 60 | 61 |
NAME DESCRIPTION STARS OFFICIAL AUTOMATED |
| 61 | 62 |
centos The official build of CentOS 1223 [OK] |
| 62 | 63 |
tianon/centos CentOS 5 and 6, created using rinse instea... 33 |
| ... | ... |
@@ -72,6 +73,7 @@ a user's repository from the image name. |
| 72 | 72 |
Once you've found the image you want, you can download it with `docker pull <imagename>`: |
| 73 | 73 |
|
| 74 | 74 |
$ docker pull centos |
| 75 |
+ |
|
| 75 | 76 |
Using default tag: latest |
| 76 | 77 |
latest: Pulling from library/centos |
| 77 | 78 |
f1b10cd84249: Pull complete |
| ... | ... |
@@ -41,26 +41,28 @@ You name your container by using the `--name` flag, for example launch a new con |
| 41 | 41 |
Use the `docker ps` command to check the name: |
| 42 | 42 |
|
| 43 | 43 |
$ docker ps -l |
| 44 |
+ |
|
| 44 | 45 |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| 45 | 46 |
aed84ee21bde training/webapp:latest python app.py 12 hours ago Up 2 seconds 0.0.0.0:49154->5000/tcp web |
| 46 | 47 |
|
| 47 | 48 |
You can also use `docker inspect` with the container's name. |
| 48 | 49 |
|
| 49 | 50 |
$ docker inspect web |
| 51 |
+ |
|
| 50 | 52 |
[ |
| 51 |
- {
|
|
| 52 |
- "Id": "3ce51710b34f5d6da95e0a340d32aa2e6cf64857fb8cdb2a6c38f7c56f448143", |
|
| 53 |
- "Created": "2015-10-25T22:44:17.854367116Z", |
|
| 54 |
- "Path": "python", |
|
| 55 |
- "Args": [ |
|
| 56 |
- "app.py" |
|
| 57 |
- ], |
|
| 58 |
- "State": {
|
|
| 59 |
- "Status": "running", |
|
| 60 |
- "Running": true, |
|
| 61 |
- "Paused": false, |
|
| 62 |
- "Restarting": false, |
|
| 63 |
- "OOMKilled": false, |
|
| 53 |
+ {
|
|
| 54 |
+ "Id": "3ce51710b34f5d6da95e0a340d32aa2e6cf64857fb8cdb2a6c38f7c56f448143", |
|
| 55 |
+ "Created": "2015-10-25T22:44:17.854367116Z", |
|
| 56 |
+ "Path": "python", |
|
| 57 |
+ "Args": [ |
|
| 58 |
+ "app.py" |
|
| 59 |
+ ], |
|
| 60 |
+ "State": {
|
|
| 61 |
+ "Status": "running", |
|
| 62 |
+ "Running": true, |
|
| 63 |
+ "Paused": false, |
|
| 64 |
+ "Restarting": false, |
|
| 65 |
+ "OOMKilled": false, |
|
| 64 | 66 |
... |
| 65 | 67 |
|
| 66 | 68 |
Container names must be unique. That means you can only call one container |
| ... | ... |
@@ -68,8 +70,11 @@ Container names must be unique. That means you can only call one container |
| 68 | 68 |
(with `docker rm`) before you can reuse the name with a new container. Go ahead and stop and remove your old `web` container. |
| 69 | 69 |
|
| 70 | 70 |
$ docker stop web |
| 71 |
+ |
|
| 71 | 72 |
web |
| 73 |
+ |
|
| 72 | 74 |
$ docker rm web |
| 75 |
+ |
|
| 73 | 76 |
web |
| 74 | 77 |
|
| 75 | 78 |
|
| ... | ... |
@@ -83,6 +88,7 @@ that you can create your own drivers but that is an advanced task. |
| 83 | 83 |
Every installation of the Docker Engine automatically includes three default networks. You can list them: |
| 84 | 84 |
|
| 85 | 85 |
$ docker network ls |
| 86 |
+ |
|
| 86 | 87 |
NETWORK ID NAME DRIVER |
| 87 | 88 |
18a2866682b8 none null |
| 88 | 89 |
c288470c46f6 host host |
| ... | ... |
@@ -91,12 +97,14 @@ Every installation of the Docker Engine automatically includes three default net |
| 91 | 91 |
The network named `bridge` is a special network. Unless you tell it otherwise, Docker always launches your containers in this network. Try this now: |
| 92 | 92 |
|
| 93 | 93 |
$ docker run -itd --name=networktest ubuntu |
| 94 |
+ |
|
| 94 | 95 |
74695c9cea6d9810718fddadc01a727a5dd3ce6a69d09752239736c030599741 |
| 95 | 96 |
|
| 96 | 97 |
Inspecting the network is an easy way to find out the container's IP address. |
| 97 | 98 |
|
| 98 | 99 |
```bash |
| 99 | 100 |
$ docker network inspect bridge |
| 101 |
+ |
|
| 100 | 102 |
[ |
| 101 | 103 |
{
|
| 102 | 104 |
"Name": "bridge", |
| ... | ... |
@@ -153,6 +161,7 @@ Docker Engine natively supports both bridge networks and overlay networks. A bri |
| 153 | 153 |
The `-d` flag tells Docker to use the `bridge` driver for the new network. You could have left this flag off as `bridge` is the default value for this flag. Go ahead and list the networks on your machine: |
| 154 | 154 |
|
| 155 | 155 |
$ docker network ls |
| 156 |
+ |
|
| 156 | 157 |
NETWORK ID NAME DRIVER |
| 157 | 158 |
7b369448dccb bridge bridge |
| 158 | 159 |
615d565d498c my-bridge-network bridge |
| ... | ... |
@@ -162,6 +171,7 @@ The `-d` flag tells Docker to use the `bridge` driver for the new network. You c |
| 162 | 162 |
If you inspect the network, you'll find that it has nothing in it. |
| 163 | 163 |
|
| 164 | 164 |
$ docker network inspect my-bridge-network |
| 165 |
+ |
|
| 165 | 166 |
[ |
| 166 | 167 |
{
|
| 167 | 168 |
"Name": "my-bridge-network", |
| ... | ... |
@@ -196,6 +206,7 @@ If you inspect your `my-bridge-network` you'll see it has a container attached. |
| 196 | 196 |
You can also inspect your container to see where it is connected: |
| 197 | 197 |
|
| 198 | 198 |
$ docker inspect --format='{{json .NetworkSettings.Networks}}' db
|
| 199 |
+ |
|
| 199 | 200 |
{"my-bridge-network":{"NetworkID":"7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99",
|
| 200 | 201 |
"EndpointID":"508b170d56b2ac9e4ef86694b0a76a22dd3df1983404f7321da5649645bf7043","Gateway":"172.18.0.1","IPAddress":"172.18.0.2","IPPrefixLen":16,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAddress":"02:42:ac:11:00:02"}} |
| 201 | 202 |
|
| ... | ... |
@@ -206,17 +217,20 @@ Now, go ahead and start your by now familiar web application. This time leave of |
| 206 | 206 |
Which network is your `web` application running under? Inspect the application and you'll find it is running in the default `bridge` network. |
| 207 | 207 |
|
| 208 | 208 |
$ docker inspect --format='{{json .NetworkSettings.Networks}}' web
|
| 209 |
+ |
|
| 209 | 210 |
{"bridge":{"NetworkID":"7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812",
|
| 210 | 211 |
"EndpointID":"508b170d56b2ac9e4ef86694b0a76a22dd3df1983404f7321da5649645bf7043","Gateway":"172.17.0.1","IPAddress":"172.17.0.2","IPPrefixLen":16,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAddress":"02:42:ac:11:00:02"}} |
| 211 | 212 |
|
| 212 | 213 |
Then, get the IP address of your `web` |
| 213 | 214 |
|
| 214 | 215 |
$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' web
|
| 216 |
+ |
|
| 215 | 217 |
172.17.0.2 |
| 216 | 218 |
|
| 217 | 219 |
Now, open a shell to your running `db` container: |
| 218 | 220 |
|
| 219 | 221 |
$ docker exec -it db bash |
| 222 |
+ |
|
| 220 | 223 |
root@a205f0dd33b2:/# ping 172.17.0.2 |
| 221 | 224 |
ping 172.17.0.2 |
| 222 | 225 |
PING 172.17.0.2 (172.17.0.2) 56(84) bytes of data. |
| ... | ... |
@@ -233,6 +247,7 @@ Docker networking allows you to attach a container to as many networks as you li |
| 233 | 233 |
Open a shell into the `db` application again and try the ping command. This time just use the container name `web` rather than the IP Address. |
| 234 | 234 |
|
| 235 | 235 |
$ docker exec -it db bash |
| 236 |
+ |
|
| 236 | 237 |
root@a205f0dd33b2:/# ping web |
| 237 | 238 |
PING web (172.18.0.3) 56(84) bytes of data. |
| 238 | 239 |
64 bytes from web (172.18.0.3): icmp_seq=1 ttl=64 time=0.095 ms |
| ... | ... |
@@ -115,6 +115,7 @@ Lastly, you've specified a command for our container to run: `python app.py`. Th |
| 115 | 115 |
Now you can see your running container using the `docker ps` command. |
| 116 | 116 |
|
| 117 | 117 |
$ docker ps -l |
| 118 |
+ |
|
| 118 | 119 |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| 119 | 120 |
bc533791f3f5 training/webapp:latest python app.py 5 seconds ago Up 2 seconds 0.0.0.0:49155->5000/tcp nostalgic_morse |
| 120 | 121 |
|
| ... | ... |
@@ -186,6 +187,7 @@ specify the ID or name of our container and then the port for which we need the |
| 186 | 186 |
corresponding public-facing port. |
| 187 | 187 |
|
| 188 | 188 |
$ docker port nostalgic_morse 5000 |
| 189 |
+ |
|
| 189 | 190 |
0.0.0.0:49155 |
| 190 | 191 |
|
| 191 | 192 |
In this case you've looked up what port is mapped externally to port 5000 inside |
| ... | ... |
@@ -197,6 +199,7 @@ You can also find out a bit more about what's happening with our application and |
| 197 | 197 |
use another of the commands you've learned, `docker logs`. |
| 198 | 198 |
|
| 199 | 199 |
$ docker logs -f nostalgic_morse |
| 200 |
+ |
|
| 200 | 201 |
* Running on http://0.0.0.0:5000/ |
| 201 | 202 |
10.0.2.2 - - [23/May/2014 20:16:31] "GET / HTTP/1.1" 200 - |
| 202 | 203 |
10.0.2.2 - - [23/May/2014 20:16:31] "GET /favicon.ico HTTP/1.1" 404 - |
| ... | ... |
@@ -212,6 +215,7 @@ In addition to the container's logs we can also examine the processes |
| 212 | 212 |
running inside it using the `docker top` command. |
| 213 | 213 |
|
| 214 | 214 |
$ docker top nostalgic_morse |
| 215 |
+ |
|
| 215 | 216 |
PID USER COMMAND |
| 216 | 217 |
854 root python app.py |
| 217 | 218 |
|
| ... | ... |
@@ -245,6 +249,7 @@ We can also narrow down the information we want to return by requesting a |
| 245 | 245 |
specific element, for example to return the container's IP address we would: |
| 246 | 246 |
|
| 247 | 247 |
$ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nostalgic_morse
|
| 248 |
+ |
|
| 248 | 249 |
172.17.0.5 |
| 249 | 250 |
|
| 250 | 251 |
## Stopping our web application container |
| ... | ... |
@@ -253,6 +258,7 @@ Okay you've seen web application working. Now you can stop it using the |
| 253 | 253 |
`docker stop` command and the name of our container: `nostalgic_morse`. |
| 254 | 254 |
|
| 255 | 255 |
$ docker stop nostalgic_morse |
| 256 |
+ |
|
| 256 | 257 |
nostalgic_morse |
| 257 | 258 |
|
| 258 | 259 |
We can now use the `docker ps` command to check if the container has |
| ... | ... |
@@ -268,6 +274,7 @@ can create a new container or restart the old one. Look at |
| 268 | 268 |
starting your previous container back up. |
| 269 | 269 |
|
| 270 | 270 |
$ docker start nostalgic_morse |
| 271 |
+ |
|
| 271 | 272 |
nostalgic_morse |
| 272 | 273 |
|
| 273 | 274 |
Now quickly run `docker ps -l` again to see the running container is |
| ... | ... |
@@ -284,6 +291,7 @@ Your colleague has let you know that they've now finished with the container |
| 284 | 284 |
and won't need it again. Now, you can remove it using the `docker rm` command. |
| 285 | 285 |
|
| 286 | 286 |
$ docker rm nostalgic_morse |
| 287 |
+ |
|
| 287 | 288 |
Error: Impossible to remove a running container, please stop it first or use -f |
| 288 | 289 |
2014/05/24 08:12:56 Error: failed to remove one or more containers |
| 289 | 290 |
|
| ... | ... |
@@ -292,8 +300,11 @@ you from accidentally removing a running container you might need. You can try |
| 292 | 292 |
this again by stopping the container first. |
| 293 | 293 |
|
| 294 | 294 |
$ docker stop nostalgic_morse |
| 295 |
+ |
|
| 295 | 296 |
nostalgic_morse |
| 297 |
+ |
|
| 296 | 298 |
$ docker rm nostalgic_morse |
| 299 |
+ |
|
| 297 | 300 |
nostalgic_morse |
| 298 | 301 |
|
| 299 | 302 |
And now our container is stopped and deleted. |
| ... | ... |
@@ -29,8 +29,11 @@ It can be as simple as this to create an Ubuntu base image: |
| 29 | 29 |
|
| 30 | 30 |
$ sudo debootstrap raring raring > /dev/null |
| 31 | 31 |
$ sudo tar -C raring -c . | docker import - raring |
| 32 |
+ |
|
| 32 | 33 |
a29c15f1bf7a |
| 34 |
+ |
|
| 33 | 35 |
$ docker run raring cat /etc/lsb-release |
| 36 |
+ |
|
| 34 | 37 |
DISTRIB_ID=Ubuntu |
| 35 | 38 |
DISTRIB_RELEASE=13.04 |
| 36 | 39 |
DISTRIB_CODENAME=raring |
| ... | ... |
@@ -23,6 +23,7 @@ when it starts: |
| 23 | 23 |
|
| 24 | 24 |
``` |
| 25 | 25 |
$ sudo iptables -t nat -L -n |
| 26 |
+ |
|
| 26 | 27 |
... |
| 27 | 28 |
Chain POSTROUTING (policy ACCEPT) |
| 28 | 29 |
target prot opt source destination |
| ... | ... |
@@ -56,6 +57,7 @@ network stack by examining your NAT tables. |
| 56 | 56 |
# is finished setting up a -P forward: |
| 57 | 57 |
|
| 58 | 58 |
$ iptables -t nat -L -n |
| 59 |
+ |
|
| 59 | 60 |
... |
| 60 | 61 |
Chain DOCKER (2 references) |
| 61 | 62 |
target prot opt source destination |
| ... | ... |
@@ -27,8 +27,11 @@ stopping the service and removing the interface: |
| 27 | 27 |
# Stopping Docker and removing docker0 |
| 28 | 28 |
|
| 29 | 29 |
$ sudo service docker stop |
| 30 |
+ |
|
| 30 | 31 |
$ sudo ip link set dev docker0 down |
| 32 |
+ |
|
| 31 | 33 |
$ sudo brctl delbr docker0 |
| 34 |
+ |
|
| 32 | 35 |
$ sudo iptables -t nat -F POSTROUTING |
| 33 | 36 |
``` |
| 34 | 37 |
|
| ... | ... |
@@ -41,12 +44,15 @@ customize `docker0`, but it will be enough to illustrate the technique. |
| 41 | 41 |
# Create our own bridge |
| 42 | 42 |
|
| 43 | 43 |
$ sudo brctl addbr bridge0 |
| 44 |
+ |
|
| 44 | 45 |
$ sudo ip addr add 192.168.5.1/24 dev bridge0 |
| 46 |
+ |
|
| 45 | 47 |
$ sudo ip link set dev bridge0 up |
| 46 | 48 |
|
| 47 | 49 |
# Confirming that our bridge is up and running |
| 48 | 50 |
|
| 49 | 51 |
$ ip addr show bridge0 |
| 52 |
+ |
|
| 50 | 53 |
4: bridge0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state UP group default |
| 51 | 54 |
link/ether 66:38:d0:0d:76:18 brd ff:ff:ff:ff:ff:ff |
| 52 | 55 |
inet 192.168.5.1/24 scope global bridge0 |
| ... | ... |
@@ -55,11 +61,13 @@ $ ip addr show bridge0 |
| 55 | 55 |
# Tell Docker about it and restart (on Ubuntu) |
| 56 | 56 |
|
| 57 | 57 |
$ echo 'DOCKER_OPTS="-b=bridge0"' >> /etc/default/docker |
| 58 |
+ |
|
| 58 | 59 |
$ sudo service docker start |
| 59 | 60 |
|
| 60 | 61 |
# Confirming new outgoing NAT masquerade is set up |
| 61 | 62 |
|
| 62 | 63 |
$ sudo iptables -t nat -L -n |
| 64 |
+ |
|
| 63 | 65 |
... |
| 64 | 66 |
Chain POSTROUTING (policy ACCEPT) |
| 65 | 67 |
target prot opt source destination |
| ... | ... |
@@ -31,9 +31,13 @@ set `--ip-forward=false` and your system's kernel has it enabled, the |
| 31 | 31 |
or to turn it on manually: |
| 32 | 32 |
``` |
| 33 | 33 |
$ sysctl net.ipv4.conf.all.forwarding |
| 34 |
+ |
|
| 34 | 35 |
net.ipv4.conf.all.forwarding = 0 |
| 36 |
+ |
|
| 35 | 37 |
$ sysctl net.ipv4.conf.all.forwarding=1 |
| 38 |
+ |
|
| 36 | 39 |
$ sysctl net.ipv4.conf.all.forwarding |
| 40 |
+ |
|
| 37 | 41 |
net.ipv4.conf.all.forwarding = 1 |
| 38 | 42 |
``` |
| 39 | 43 |
|
| ... | ... |
@@ -98,6 +102,7 @@ You can run the `iptables` command on your Docker host to see whether the `FORWA |
| 98 | 98 |
# When --icc=false, you should see a DROP rule: |
| 99 | 99 |
|
| 100 | 100 |
$ sudo iptables -L -n |
| 101 |
+ |
|
| 101 | 102 |
... |
| 102 | 103 |
Chain FORWARD (policy ACCEPT) |
| 103 | 104 |
target prot opt source destination |
| ... | ... |
@@ -110,6 +115,7 @@ DROP all -- 0.0.0.0/0 0.0.0.0/0 |
| 110 | 110 |
# the subsequent DROP policy for all other packets: |
| 111 | 111 |
|
| 112 | 112 |
$ sudo iptables -L -n |
| 113 |
+ |
|
| 113 | 114 |
... |
| 114 | 115 |
Chain FORWARD (policy ACCEPT) |
| 115 | 116 |
target prot opt source destination |
| ... | ... |
@@ -30,6 +30,7 @@ Once you have one or more containers up and running, you can confirm that Docker |
| 30 | 30 |
# Display bridge info |
| 31 | 31 |
|
| 32 | 32 |
$ sudo brctl show |
| 33 |
+ |
|
| 33 | 34 |
bridge name bridge id STP enabled interfaces |
| 34 | 35 |
docker0 8000.3a1d7362b4ee no veth65f9 |
| 35 | 36 |
vethdda6 |
| ... | ... |
@@ -45,6 +46,7 @@ Finally, the `docker0` Ethernet bridge settings are used every time you create a |
| 45 | 45 |
$ docker run -i -t --rm base /bin/bash |
| 46 | 46 |
|
| 47 | 47 |
$$ ip addr show eth0 |
| 48 |
+ |
|
| 48 | 49 |
24: eth0: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 |
| 49 | 50 |
link/ether 32:6f:e0:35:57:91 brd ff:ff:ff:ff:ff:ff |
| 50 | 51 |
inet 172.17.0.3/16 scope global eth0 |
| ... | ... |
@@ -53,6 +55,7 @@ $$ ip addr show eth0 |
| 53 | 53 |
valid_lft forever preferred_lft forever |
| 54 | 54 |
|
| 55 | 55 |
$$ ip route |
| 56 |
+ |
|
| 56 | 57 |
default via 172.17.42.1 dev eth0 |
| 57 | 58 |
172.17.0.0/16 dev eth0 proto kernel scope link src 172.17.0.3 |
| 58 | 59 |
|
| ... | ... |
@@ -43,6 +43,7 @@ range* on your Docker host. Next, when `docker ps` was run, you saw that port |
| 43 | 43 |
5000 in the container was bound to port 49155 on the host. |
| 44 | 44 |
|
| 45 | 45 |
$ docker ps nostalgic_morse |
| 46 |
+ |
|
| 46 | 47 |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| 47 | 48 |
bc533791f3f5 training/webapp:latest python app.py 5 seconds ago Up 2 seconds 0.0.0.0:49155->5000/tcp nostalgic_morse |
| 48 | 49 |
|
| ... | ... |
@@ -88,6 +89,7 @@ configurations. For example, if you've bound the container port to the |
| 88 | 88 |
`localhost` on the host machine, then the `docker port` output will reflect that. |
| 89 | 89 |
|
| 90 | 90 |
$ docker port nostalgic_morse 5000 |
| 91 |
+ |
|
| 91 | 92 |
127.0.0.1:49155 |
| 92 | 93 |
|
| 93 | 94 |
> **Note:** |
| ... | ... |
@@ -132,6 +134,7 @@ name the container `web`. You can see the container's name using the |
| 132 | 132 |
`docker ps` command. |
| 133 | 133 |
|
| 134 | 134 |
$ docker ps -l |
| 135 |
+ |
|
| 135 | 136 |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| 136 | 137 |
aed84ee21bde training/webapp:latest python app.py 12 hours ago Up 2 seconds 0.0.0.0:49154->5000/tcp web |
| 137 | 138 |
|
| ... | ... |
@@ -187,6 +190,7 @@ example as: |
| 187 | 187 |
Next, inspect your linked containers with `docker inspect`: |
| 188 | 188 |
|
| 189 | 189 |
$ docker inspect -f "{{ .HostConfig.Links }}" web
|
| 190 |
+ |
|
| 190 | 191 |
[/db:/web/db] |
| 191 | 192 |
|
| 192 | 193 |
You can see that the `web` container is now linked to the `db` container |
| ... | ... |
@@ -273,6 +277,7 @@ command to list the specified container's environment variables. |
| 273 | 273 |
|
| 274 | 274 |
``` |
| 275 | 275 |
$ docker run --rm --name web2 --link db:db training/webapp env |
| 276 |
+ |
|
| 276 | 277 |
. . . |
| 277 | 278 |
DB_NAME=/web2/db |
| 278 | 279 |
DB_PORT=tcp://172.17.0.5:5432 |
| ... | ... |
@@ -310,7 +315,9 @@ source container to the `/etc/hosts` file. Here's an entry for the `web` |
| 310 | 310 |
container: |
| 311 | 311 |
|
| 312 | 312 |
$ docker run -t -i --rm --link db:webdb training/webapp /bin/bash |
| 313 |
+ |
|
| 313 | 314 |
root@aed84ee21bde:/opt/webapp# cat /etc/hosts |
| 315 |
+ |
|
| 314 | 316 |
172.17.0.7 aed84ee21bde |
| 315 | 317 |
. . . |
| 316 | 318 |
172.17.0.5 webdb 6e5cdeb2d300 db |
| ... | ... |
@@ -324,7 +331,9 @@ also be added in `/etc/hosts` for the linked container's IP address. You can pin |
| 324 | 324 |
that host now via any of these entries: |
| 325 | 325 |
|
| 326 | 326 |
root@aed84ee21bde:/opt/webapp# apt-get install -yqq inetutils-ping |
| 327 |
+ |
|
| 327 | 328 |
root@aed84ee21bde:/opt/webapp# ping webdb |
| 329 |
+ |
|
| 328 | 330 |
PING webdb (172.17.0.5): 48 data bytes |
| 329 | 331 |
56 bytes from 172.17.0.5: icmp_seq=0 ttl=64 time=0.267 ms |
| 330 | 332 |
56 bytes from 172.17.0.5: icmp_seq=1 ttl=64 time=0.250 ms |
| ... | ... |
@@ -348,9 +357,13 @@ will be automatically updated with the source container's new IP address, |
| 348 | 348 |
allowing linked communication to continue. |
| 349 | 349 |
|
| 350 | 350 |
$ docker restart db |
| 351 |
+ |
|
| 351 | 352 |
db |
| 353 |
+ |
|
| 352 | 354 |
$ docker run -t -i --rm --link db:db training/webapp /bin/bash |
| 355 |
+ |
|
| 353 | 356 |
root@aed84ee21bde:/opt/webapp# cat /etc/hosts |
| 357 |
+ |
|
| 354 | 358 |
172.17.0.7 aed84ee21bde |
| 355 | 359 |
. . . |
| 356 | 360 |
172.17.0.9 db |
| ... | ... |
@@ -48,7 +48,9 @@ starting dockerd with `--ip-forward=false`): |
| 48 | 48 |
|
| 49 | 49 |
``` |
| 50 | 50 |
$ ip -6 route add 2001:db8:1::/64 dev docker0 |
| 51 |
+ |
|
| 51 | 52 |
$ sysctl net.ipv6.conf.default.forwarding=1 |
| 53 |
+ |
|
| 52 | 54 |
$ sysctl net.ipv6.conf.all.forwarding=1 |
| 53 | 55 |
``` |
| 54 | 56 |
|
| ... | ... |
@@ -113,6 +115,7 @@ configure the IPv6 addresses `2001:db8::c000` to `2001:db8::c00f`: |
| 113 | 113 |
|
| 114 | 114 |
``` |
| 115 | 115 |
$ ip -6 addr show |
| 116 |
+ |
|
| 116 | 117 |
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 |
| 117 | 118 |
inet6 ::1/128 scope host |
| 118 | 119 |
valid_lft forever preferred_lft forever |
| ... | ... |
@@ -165,6 +168,7 @@ device to the container network: |
| 165 | 165 |
|
| 166 | 166 |
``` |
| 167 | 167 |
$ ip -6 route show |
| 168 |
+ |
|
| 168 | 169 |
2001:db8::c008/125 dev docker0 metric 1 |
| 169 | 170 |
2001:db8::/64 dev eth0 proto kernel metric 256 |
| 170 | 171 |
``` |
| ... | ... |
@@ -29,6 +29,7 @@ these networks using the `docker network ls` command: |
| 29 | 29 |
|
| 30 | 30 |
``` |
| 31 | 31 |
$ docker network ls |
| 32 |
+ |
|
| 32 | 33 |
NETWORK ID NAME DRIVER |
| 33 | 34 |
7fca4eb8c647 bridge bridge |
| 34 | 35 |
9f904ee27bf5 none null |
| ... | ... |
@@ -47,6 +48,7 @@ the `ifconfig` command on the host. |
| 47 | 47 |
|
| 48 | 48 |
``` |
| 49 | 49 |
$ ifconfig |
| 50 |
+ |
|
| 50 | 51 |
docker0 Link encap:Ethernet HWaddr 02:42:47:bc:3a:eb |
| 51 | 52 |
inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0 |
| 52 | 53 |
inet6 addr: fe80::42:47ff:febc:3aeb/64 Scope:Link |
| ... | ... |
@@ -100,6 +102,7 @@ command returns information about a network: |
| 100 | 100 |
|
| 101 | 101 |
``` |
| 102 | 102 |
$ docker network inspect bridge |
| 103 |
+ |
|
| 103 | 104 |
[ |
| 104 | 105 |
{
|
| 105 | 106 |
"Name": "bridge", |
| ... | ... |
@@ -132,9 +135,11 @@ The `docker run` command automatically adds new containers to this network. |
| 132 | 132 |
|
| 133 | 133 |
``` |
| 134 | 134 |
$ docker run -itd --name=container1 busybox |
| 135 |
+ |
|
| 135 | 136 |
3386a527aa08b37ea9232cbcace2d2458d49f44bb05a6b775fba7ddd40d8f92c |
| 136 | 137 |
|
| 137 | 138 |
$ docker run -itd --name=container2 busybox |
| 139 |
+ |
|
| 138 | 140 |
94447ca479852d29aeddca75c28f7104df3c3196d7b6d83061879e339946805c |
| 139 | 141 |
``` |
| 140 | 142 |
|
| ... | ... |
@@ -142,6 +147,7 @@ Inspecting the `bridge` network again after starting two containers shows both n |
| 142 | 142 |
|
| 143 | 143 |
``` |
| 144 | 144 |
$ docker network inspect bridge |
| 145 |
+ |
|
| 145 | 146 |
{[
|
| 146 | 147 |
{
|
| 147 | 148 |
"Name": "bridge", |
| ... | ... |
@@ -215,6 +221,7 @@ Then use `ping` for about 3 seconds to test the connectivity of the containers o |
| 215 | 215 |
|
| 216 | 216 |
``` |
| 217 | 217 |
root@0cb243cd1293:/# ping -w3 172.17.0.3 |
| 218 |
+ |
|
| 218 | 219 |
PING 172.17.0.3 (172.17.0.3): 56 data bytes |
| 219 | 220 |
64 bytes from 172.17.0.3: seq=0 ttl=64 time=0.096 ms |
| 220 | 221 |
64 bytes from 172.17.0.3: seq=1 ttl=64 time=0.080 ms |
| ... | ... |
@@ -229,6 +236,7 @@ Finally, use the `cat` command to check the `container1` network configuration: |
| 229 | 229 |
|
| 230 | 230 |
``` |
| 231 | 231 |
root@0cb243cd1293:/# cat /etc/hosts |
| 232 |
+ |
|
| 232 | 233 |
172.17.0.2 3386a527aa08 |
| 233 | 234 |
127.0.0.1 localhost |
| 234 | 235 |
::1 localhost ip6-localhost ip6-loopback |
| ... | ... |
@@ -243,6 +251,7 @@ To detach from a `container1` and leave it running use `CTRL-p CTRL-q`.Then, att |
| 243 | 243 |
$ docker attach container2 |
| 244 | 244 |
|
| 245 | 245 |
root@0cb243cd1293:/# ifconfig |
| 246 |
+ |
|
| 246 | 247 |
eth0 Link encap:Ethernet HWaddr 02:42:AC:11:00:03 |
| 247 | 248 |
inet addr:172.17.0.3 Bcast:0.0.0.0 Mask:255.255.0.0 |
| 248 | 249 |
inet6 addr: fe80::42:acff:fe11:3/64 Scope:Link |
| ... | ... |
@@ -262,6 +271,7 @@ lo Link encap:Local Loopback |
| 262 | 262 |
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) |
| 263 | 263 |
|
| 264 | 264 |
root@0cb243cd1293:/# ping -w3 172.17.0.2 |
| 265 |
+ |
|
| 265 | 266 |
PING 172.17.0.2 (172.17.0.2): 56 data bytes |
| 266 | 267 |
64 bytes from 172.17.0.2: seq=0 ttl=64 time=0.067 ms |
| 267 | 268 |
64 bytes from 172.17.0.2: seq=1 ttl=64 time=0.075 ms |
| ... | ... |
@@ -311,6 +321,7 @@ $ docker network create --driver bridge isolated_nw |
| 311 | 311 |
1196a4c5af43a21ae38ef34515b6af19236a3fc48122cf585e3f3054d509679b |
| 312 | 312 |
|
| 313 | 313 |
$ docker network inspect isolated_nw |
| 314 |
+ |
|
| 314 | 315 |
[ |
| 315 | 316 |
{
|
| 316 | 317 |
"Name": "isolated_nw", |
| ... | ... |
@@ -332,6 +343,7 @@ $ docker network inspect isolated_nw |
| 332 | 332 |
] |
| 333 | 333 |
|
| 334 | 334 |
$ docker network ls |
| 335 |
+ |
|
| 335 | 336 |
NETWORK ID NAME DRIVER |
| 336 | 337 |
9f904ee27bf5 none null |
| 337 | 338 |
cf03ee007fb4 host host |
| ... | ... |
@@ -344,6 +356,7 @@ After you create the network, you can launch containers on it using the `docker |
| 344 | 344 |
|
| 345 | 345 |
``` |
| 346 | 346 |
$ docker run --net=isolated_nw -itd --name=container3 busybox |
| 347 |
+ |
|
| 347 | 348 |
8c1a0a5be480921d669a073393ade66a3fc49933f08bcc5515b37b8144f6d47c |
| 348 | 349 |
|
| 349 | 350 |
$ docker network inspect isolated_nw |
| ... | ... |
@@ -73,6 +73,7 @@ key-value stores. This example uses Consul. |
| 73 | 73 |
5. Run the `docker ps` command to see the `consul` container. |
| 74 | 74 |
|
| 75 | 75 |
$ docker ps |
| 76 |
+ |
|
| 76 | 77 |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| 77 | 78 |
4d51392253b3 progrium/consul "/bin/start -server -" 25 minutes ago Up 25 minutes 53/tcp, 53/udp, 8300-8302/tcp, 0.0.0.0:8500->8500/tcp, 8400/tcp, 8301-8302/udp admiring_panini |
| 78 | 79 |
|
| ... | ... |
@@ -111,6 +112,7 @@ that machine options that are needed by the `overlay` network driver. |
| 111 | 111 |
3. List your machines to confirm they are all up and running. |
| 112 | 112 |
|
| 113 | 113 |
$ docker-machine ls |
| 114 |
+ |
|
| 114 | 115 |
NAME ACTIVE DRIVER STATE URL SWARM |
| 115 | 116 |
default - virtualbox Running tcp://192.168.99.100:2376 |
| 116 | 117 |
mh-keystore * virtualbox Running tcp://192.168.99.103:2376 |
| ... | ... |
@@ -134,6 +136,7 @@ To create an overlay network |
| 134 | 134 |
2. Use the `docker info` command to view the Swarm. |
| 135 | 135 |
|
| 136 | 136 |
$ docker info |
| 137 |
+ |
|
| 137 | 138 |
Containers: 3 |
| 138 | 139 |
Images: 2 |
| 139 | 140 |
Role: primary |
| ... | ... |
@@ -171,6 +174,7 @@ To create an overlay network |
| 171 | 171 |
4. Check that the network is running: |
| 172 | 172 |
|
| 173 | 173 |
$ docker network ls |
| 174 |
+ |
|
| 174 | 175 |
NETWORK ID NAME DRIVER |
| 175 | 176 |
412c2496d0eb mhs-demo1/host host |
| 176 | 177 |
dd51763e6dd2 mhs-demo0/bridge bridge |
| ... | ... |
@@ -187,14 +191,19 @@ To create an overlay network |
| 187 | 187 |
5. Switch to each Swarm agent in turn and list the networks. |
| 188 | 188 |
|
| 189 | 189 |
$ eval $(docker-machine env mhs-demo0) |
| 190 |
+ |
|
| 190 | 191 |
$ docker network ls |
| 192 |
+ |
|
| 191 | 193 |
NETWORK ID NAME DRIVER |
| 192 | 194 |
6b07d0be843f my-net overlay |
| 193 | 195 |
dd51763e6dd2 bridge bridge |
| 194 | 196 |
b4234109bd9b none null |
| 195 | 197 |
1aeead6dd890 host host |
| 198 |
+ |
|
| 196 | 199 |
$ eval $(docker-machine env mhs-demo1) |
| 200 |
+ |
|
| 197 | 201 |
$ docker network ls |
| 202 |
+ |
|
| 198 | 203 |
NETWORK ID NAME DRIVER |
| 199 | 204 |
d0bb78cbe7bd bridge bridge |
| 200 | 205 |
1c0eb8f69ebb none null |
| ... | ... |
@@ -219,6 +228,7 @@ Once your network is created, you can start a container on any of the hosts and |
| 219 | 219 |
4. Run a BusyBox instance on the `mhs-demo1` instance and get the contents of the Nginx server's home page. |
| 220 | 220 |
|
| 221 | 221 |
$ docker run -it --rm --net=my-net --env="constraint:node==mhs-demo1" busybox wget -O- http://web |
| 222 |
+ |
|
| 222 | 223 |
Unable to find image 'busybox:latest' locally |
| 223 | 224 |
latest: Pulling from library/busybox |
| 224 | 225 |
ab2b8a86ca6c: Pull complete |
| ... | ... |
@@ -268,6 +278,7 @@ to have external connectivity outside of their cluster. |
| 268 | 268 |
2. View the `docker_gwbridge` network, by listing the networks. |
| 269 | 269 |
|
| 270 | 270 |
$ docker network ls |
| 271 |
+ |
|
| 271 | 272 |
NETWORK ID NAME DRIVER |
| 272 | 273 |
6b07d0be843f my-net overlay |
| 273 | 274 |
dd51763e6dd2 bridge bridge |
| ... | ... |
@@ -278,7 +289,9 @@ to have external connectivity outside of their cluster. |
| 278 | 278 |
3. Repeat steps 1 and 2 on the Swarm master. |
| 279 | 279 |
|
| 280 | 280 |
$ eval $(docker-machine env mhs-demo0) |
| 281 |
+ |
|
| 281 | 282 |
$ docker network ls |
| 283 |
+ |
|
| 282 | 284 |
NETWORK ID NAME DRIVER |
| 283 | 285 |
6b07d0be843f my-net overlay |
| 284 | 286 |
d0bb78cbe7bd bridge bridge |
| ... | ... |
@@ -289,6 +302,7 @@ to have external connectivity outside of their cluster. |
| 289 | 289 |
2. Check the Nginx container's network interfaces. |
| 290 | 290 |
|
| 291 | 291 |
$ docker exec web ip addr |
| 292 |
+ |
|
| 292 | 293 |
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default |
| 293 | 294 |
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 |
| 294 | 295 |
inet 127.0.0.1/8 scope host lo |
| ... | ... |
@@ -42,7 +42,9 @@ bridge network for you. |
| 42 | 42 |
|
| 43 | 43 |
```bash |
| 44 | 44 |
$ docker network create simple-network |
| 45 |
+ |
|
| 45 | 46 |
69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a |
| 47 |
+ |
|
| 46 | 48 |
$ docker network inspect simple-network |
| 47 | 49 |
[ |
| 48 | 50 |
{
|
| ... | ... |
@@ -134,8 +136,11 @@ For example, now let's use `-o` or `--opt` options to specify an IP address bind |
| 134 | 134 |
|
| 135 | 135 |
```bash |
| 136 | 136 |
$ docker network create -o "com.docker.network.bridge.host_binding_ipv4"="172.23.0.1" my-network |
| 137 |
+ |
|
| 137 | 138 |
b1a086897963e6a2e7fc6868962e55e746bee8ad0c97b54a5831054b5f62672a |
| 139 |
+ |
|
| 138 | 140 |
$ docker network inspect my-network |
| 141 |
+ |
|
| 139 | 142 |
[ |
| 140 | 143 |
{
|
| 141 | 144 |
"Name": "my-network", |
| ... | ... |
@@ -158,9 +163,13 @@ $ docker network inspect my-network |
| 158 | 158 |
} |
| 159 | 159 |
} |
| 160 | 160 |
] |
| 161 |
+ |
|
| 161 | 162 |
$ docker run -d -P --name redis --net my-network redis |
| 163 |
+ |
|
| 162 | 164 |
bafb0c808c53104b2c90346f284bda33a69beadcab4fc83ab8f2c5a4410cd129 |
| 165 |
+ |
|
| 163 | 166 |
$ docker ps |
| 167 |
+ |
|
| 164 | 168 |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| 165 | 169 |
bafb0c808c53 redis "/entrypoint.sh redis" 4 seconds ago Up 3 seconds 172.23.0.1:32770->6379/tcp redis |
| 166 | 170 |
``` |
| ... | ... |
@@ -179,9 +188,11 @@ Create two containers for this example: |
| 179 | 179 |
|
| 180 | 180 |
```bash |
| 181 | 181 |
$ docker run -itd --name=container1 busybox |
| 182 |
+ |
|
| 182 | 183 |
18c062ef45ac0c026ee48a83afa39d25635ee5f02b58de4abc8f467bcaa28731 |
| 183 | 184 |
|
| 184 | 185 |
$ docker run -itd --name=container2 busybox |
| 186 |
+ |
|
| 185 | 187 |
498eaaaf328e1018042c04b2de04036fc04719a6e39a097a4f4866043a2c2152 |
| 186 | 188 |
``` |
| 187 | 189 |
|
| ... | ... |
@@ -189,6 +200,7 @@ Then create an isolated, `bridge` network to test with. |
| 189 | 189 |
|
| 190 | 190 |
```bash |
| 191 | 191 |
$ docker network create -d bridge --subnet 172.25.0.0/16 isolated_nw |
| 192 |
+ |
|
| 192 | 193 |
06a62f1c73c4e3107c0f555b7a5f163309827bfbbf999840166065a8f35455a8 |
| 193 | 194 |
``` |
| 194 | 195 |
|
| ... | ... |
@@ -197,7 +209,9 @@ the connection: |
| 197 | 197 |
|
| 198 | 198 |
``` |
| 199 | 199 |
$ docker network connect isolated_nw container2 |
| 200 |
+ |
|
| 200 | 201 |
$ docker network inspect isolated_nw |
| 202 |
+ |
|
| 201 | 203 |
[ |
| 202 | 204 |
{
|
| 203 | 205 |
"Name": "isolated_nw", |
| ... | ... |
@@ -234,6 +248,7 @@ the network on launch using the `docker run` command's `--net` option: |
| 234 | 234 |
|
| 235 | 235 |
```bash |
| 236 | 236 |
$ docker run --net=isolated_nw --ip=172.25.3.3 -itd --name=container3 busybox |
| 237 |
+ |
|
| 237 | 238 |
467a7863c3f0277ef8e661b38427737f28099b61fa55622d6c30fb288d88c551 |
| 238 | 239 |
``` |
| 239 | 240 |
|
| ... | ... |
@@ -251,6 +266,7 @@ Now, inspect the network resources used by `container3`. |
| 251 | 251 |
|
| 252 | 252 |
```bash |
| 253 | 253 |
$ docker inspect --format='{{json .NetworkSettings.Networks}}' container3
|
| 254 |
+ |
|
| 254 | 255 |
{"isolated_nw":{"IPAMConfig":{"IPv4Address":"172.25.3.3"},"NetworkID":"1196a4c5af43a21ae38ef34515b6af19236a3fc48122cf585e3f3054d509679b",
|
| 255 | 256 |
"EndpointID":"dffc7ec2915af58cc827d995e6ebdc897342be0420123277103c40ae35579103","Gateway":"172.25.0.1","IPAddress":"172.25.3.3","IPPrefixLen":16,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAddress":"02:42:ac:19:03:03"}} |
| 256 | 257 |
``` |
| ... | ... |
@@ -258,6 +274,7 @@ Repeat this command for `container2`. If you have Python installed, you can pret |
| 258 | 258 |
|
| 259 | 259 |
```bash |
| 260 | 260 |
$ docker inspect --format='{{json .NetworkSettings.Networks}}' container2 | python -m json.tool
|
| 261 |
+ |
|
| 261 | 262 |
{
|
| 262 | 263 |
"bridge": {
|
| 263 | 264 |
"NetworkID":"7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", |
| ... | ... |
@@ -391,6 +408,7 @@ same network and cannot communicate. Test, this now by attaching to |
| 391 | 391 |
|
| 392 | 392 |
```bash |
| 393 | 393 |
$ docker attach container3 |
| 394 |
+ |
|
| 394 | 395 |
/ # ping 172.17.0.2 |
| 395 | 396 |
PING 172.17.0.2 (172.17.0.2): 56 data bytes |
| 396 | 397 |
^C |
| ... | ... |
@@ -433,6 +451,7 @@ for other containers in the same network. |
| 433 | 433 |
|
| 434 | 434 |
```bash |
| 435 | 435 |
$ docker run --net=isolated_nw -itd --name=container4 --link container5:c5 busybox |
| 436 |
+ |
|
| 436 | 437 |
01b5df970834b77a9eadbaff39051f237957bd35c4c56f11193e0594cfd5117c |
| 437 | 438 |
``` |
| 438 | 439 |
|
| ... | ... |
@@ -453,6 +472,7 @@ c4. |
| 453 | 453 |
|
| 454 | 454 |
```bash |
| 455 | 455 |
$ docker run --net=isolated_nw -itd --name=container5 --link container4:c4 busybox |
| 456 |
+ |
|
| 456 | 457 |
72eccf2208336f31e9e33ba327734125af00d1e1d2657878e2ee8154fbb23c7a |
| 457 | 458 |
``` |
| 458 | 459 |
|
| ... | ... |
@@ -462,6 +482,7 @@ container name and its alias c5 and `container5` will be able to reach |
| 462 | 462 |
|
| 463 | 463 |
```bash |
| 464 | 464 |
$ docker attach container4 |
| 465 |
+ |
|
| 465 | 466 |
/ # ping -w 4 c5 |
| 466 | 467 |
PING c5 (172.25.0.5): 56 data bytes |
| 467 | 468 |
64 bytes from 172.25.0.5: seq=0 ttl=64 time=0.070 ms |
| ... | ... |
@@ -487,6 +508,7 @@ round-trip min/avg/max = 0.070/0.081/0.097 ms |
| 487 | 487 |
|
| 488 | 488 |
```bash |
| 489 | 489 |
$ docker attach container5 |
| 490 |
+ |
|
| 490 | 491 |
/ # ping -w 4 c4 |
| 491 | 492 |
PING c4 (172.25.0.4): 56 data bytes |
| 492 | 493 |
64 bytes from 172.25.0.4: seq=0 ttl=64 time=0.065 ms |
| ... | ... |
@@ -608,11 +630,13 @@ with a network alias. |
| 608 | 608 |
|
| 609 | 609 |
```bash |
| 610 | 610 |
$ docker run --net=isolated_nw -itd --name=container6 --net-alias app busybox |
| 611 |
+ |
|
| 611 | 612 |
8ebe6767c1e0361f27433090060b33200aac054a68476c3be87ef4005eb1df17 |
| 612 | 613 |
``` |
| 613 | 614 |
|
| 614 | 615 |
```bash |
| 615 | 616 |
$ docker attach container4 |
| 617 |
+ |
|
| 616 | 618 |
/ # ping -w 4 app |
| 617 | 619 |
PING app (172.25.0.6): 56 data bytes |
| 618 | 620 |
64 bytes from 172.25.0.6: seq=0 ttl=64 time=0.070 ms |
| ... | ... |
@@ -679,6 +703,7 @@ network-scoped alias within the same network. For example, let's launch |
| 679 | 679 |
|
| 680 | 680 |
```bash |
| 681 | 681 |
$ docker run --net=isolated_nw -itd --name=container7 --net-alias app busybox |
| 682 |
+ |
|
| 682 | 683 |
3138c678c123b8799f4c7cc6a0cecc595acbdfa8bf81f621834103cd4f504554 |
| 683 | 684 |
``` |
| 684 | 685 |
|
| ... | ... |
@@ -692,6 +717,7 @@ verify that `container7` is resolving the `app` alias. |
| 692 | 692 |
|
| 693 | 693 |
```bash |
| 694 | 694 |
$ docker attach container4 |
| 695 |
+ |
|
| 695 | 696 |
/ # ping -w 4 app |
| 696 | 697 |
PING app (172.25.0.6): 56 data bytes |
| 697 | 698 |
64 bytes from 172.25.0.6: seq=0 ttl=64 time=0.070 ms |
| ... | ... |
@@ -706,6 +732,7 @@ round-trip min/avg/max = 0.070/0.081/0.097 ms |
| 706 | 706 |
$ docker stop container6 |
| 707 | 707 |
|
| 708 | 708 |
$ docker attach container4 |
| 709 |
+ |
|
| 709 | 710 |
/ # ping -w 4 app |
| 710 | 711 |
PING app (172.25.0.7): 56 data bytes |
| 711 | 712 |
64 bytes from 172.25.0.7: seq=0 ttl=64 time=0.095 ms |
| ... | ... |
@@ -728,6 +755,7 @@ disconnect` command. |
| 728 | 728 |
$ docker network disconnect isolated_nw container2 |
| 729 | 729 |
|
| 730 | 730 |
$ docker inspect --format='{{json .NetworkSettings.Networks}}' container2 | python -m json.tool
|
| 731 |
+ |
|
| 731 | 732 |
{
|
| 732 | 733 |
"bridge": {
|
| 733 | 734 |
"NetworkID":"7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", |
| ... | ... |
@@ -744,6 +772,7 @@ $ docker inspect --format='{{json .NetworkSettings.Networks}}' container2 | pyt
|
| 744 | 744 |
|
| 745 | 745 |
|
| 746 | 746 |
$ docker network inspect isolated_nw |
| 747 |
+ |
|
| 747 | 748 |
[ |
| 748 | 749 |
{
|
| 749 | 750 |
"Name": "isolated_nw", |
| ... | ... |
@@ -831,12 +860,15 @@ be connected to the network. |
| 831 | 831 |
|
| 832 | 832 |
```bash |
| 833 | 833 |
$ docker run -d --name redis_db --net multihost redis |
| 834 |
+ |
|
| 834 | 835 |
ERROR: Cannot start container bc0b19c089978f7845633027aa3435624ca3d12dd4f4f764b61eac4c0610f32e: container already connected to network multihost |
| 835 | 836 |
|
| 836 | 837 |
$ docker rm -f redis_db |
| 838 |
+ |
|
| 837 | 839 |
$ docker network disconnect -f multihost redis_db |
| 838 | 840 |
|
| 839 | 841 |
$ docker run -d --name redis_db --net multihost redis |
| 842 |
+ |
|
| 840 | 843 |
7d986da974aeea5e9f7aca7e510bdb216d58682faa83a9040c2f2adc0544795a |
| 841 | 844 |
``` |
| 842 | 845 |
|
| ... | ... |
@@ -851,6 +883,7 @@ $ docker network disconnect isolated_nw container3 |
| 851 | 851 |
|
| 852 | 852 |
```bash |
| 853 | 853 |
docker network inspect isolated_nw |
| 854 |
+ |
|
| 854 | 855 |
[ |
| 855 | 856 |
{
|
| 856 | 857 |
"Name": "isolated_nw", |
| ... | ... |
@@ -878,6 +911,7 @@ List all your networks to verify the `isolated_nw` was removed: |
| 878 | 878 |
|
| 879 | 879 |
```bash |
| 880 | 880 |
$ docker network ls |
| 881 |
+ |
|
| 881 | 882 |
NETWORK ID NAME DRIVER |
| 882 | 883 |
72314fa53006 host host |
| 883 | 884 |
f7ab26d71dbd bridge bridge |
| ... | ... |
@@ -97,6 +97,7 @@ You can only use the AUFS storage driver on Linux systems with AUFS installed. |
| 97 | 97 |
Use the following command to determine if your system supports AUFS. |
| 98 | 98 |
|
| 99 | 99 |
$ grep aufs /proc/filesystems |
| 100 |
+ |
|
| 100 | 101 |
nodev aufs |
| 101 | 102 |
|
| 102 | 103 |
This output indicates the system supports AUFS. Once you've verified your |
| ... | ... |
@@ -116,6 +117,7 @@ Once your daemon is running, verify the storage driver with the `docker info` |
| 116 | 116 |
command. |
| 117 | 117 |
|
| 118 | 118 |
$ sudo docker info |
| 119 |
+ |
|
| 119 | 120 |
Containers: 1 |
| 120 | 121 |
Images: 4 |
| 121 | 122 |
Storage Driver: aufs |
| ... | ... |
@@ -153,6 +155,7 @@ stacked below it in the union mount. Remember, these directory names do no map |
| 153 | 153 |
to image layer IDs with Docker 1.10 and higher. |
| 154 | 154 |
|
| 155 | 155 |
$ cat /var/lib/docker/aufs/layers/91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c |
| 156 |
+ |
|
| 156 | 157 |
d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82 |
| 157 | 158 |
c22013c8472965aa5b62559f2b540cd440716ef149756e7b958a1b2aba421e87 |
| 158 | 159 |
d3a1f33e8a5a513092f01bb7eb1c2abf4d711e5105390a3fe1ae2248cfde1391 |
| ... | ... |
@@ -112,6 +112,7 @@ commands. The example below shows a truncated output of an `ls -l` command an |
| 112 | 112 |
image layer: |
| 113 | 113 |
|
| 114 | 114 |
$ ls -l /var/lib/docker/btrfs/subvolumes/0a17decee4139b0de68478f149cc16346f5e711c5ae3bb969895f22dd6723751/ |
| 115 |
+ |
|
| 115 | 116 |
total 0 |
| 116 | 117 |
drwxr-xr-x 1 root root 1372 Oct 9 08:39 bin |
| 117 | 118 |
drwxr-xr-x 1 root root 0 Apr 10 2014 boot |
| ... | ... |
@@ -173,6 +174,7 @@ Assuming your system meets the prerequisites, do the following: |
| 173 | 173 |
1. Install the "btrfs-tools" package. |
| 174 | 174 |
|
| 175 | 175 |
$ sudo apt-get install btrfs-tools |
| 176 |
+ |
|
| 176 | 177 |
Reading package lists... Done |
| 177 | 178 |
Building dependency tree |
| 178 | 179 |
<output truncated> |
| ... | ... |
@@ -184,6 +186,7 @@ multiple devices to the `mkfs.btrfs` command creates a pool across all of those |
| 184 | 184 |
devices. Here you create a pool with a single device at `/dev/xvdb`. |
| 185 | 185 |
|
| 186 | 186 |
$ sudo mkfs.btrfs -f /dev/xvdb |
| 187 |
+ |
|
| 187 | 188 |
WARNING! - Btrfs v3.12 IS EXPERIMENTAL |
| 188 | 189 |
WARNING! - see http://btrfs.wiki.kernel.org before using |
| 189 | 190 |
|
| ... | ... |
@@ -209,6 +212,7 @@ multiple devices to the `mkfs.btrfs` command creates a pool across all of those |
| 209 | 209 |
a. Obtain the Btrfs filesystem's UUID. |
| 210 | 210 |
|
| 211 | 211 |
$ sudo blkid /dev/xvdb |
| 212 |
+ |
|
| 212 | 213 |
/dev/xvdb: UUID="a0ed851e-158b-4120-8416-c9b072c8cf47" UUID_SUB="c3927a64-4454-4eef-95c2-a7d44ac0cf27" TYPE="btrfs" |
| 213 | 214 |
|
| 214 | 215 |
b. Create an `/etc/fstab` entry to automatically mount `/var/lib/docker` |
| ... | ... |
@@ -222,7 +226,9 @@ remember to substitute the UUID value with the value obtained from the previous |
| 222 | 222 |
5. Mount the new filesystem and verify the operation. |
| 223 | 223 |
|
| 224 | 224 |
$ sudo mount -a |
| 225 |
+ |
|
| 225 | 226 |
$ mount |
| 227 |
+ |
|
| 226 | 228 |
/dev/xvda1 on / type ext4 (rw,discard) |
| 227 | 229 |
<output truncated> |
| 228 | 230 |
/dev/xvdb on /var/lib/docker type btrfs (rw) |
| ... | ... |
@@ -236,6 +242,7 @@ should automatically load with the `btrfs` storage driver. |
| 236 | 236 |
1. Start the Docker daemon. |
| 237 | 237 |
|
| 238 | 238 |
$ sudo service docker start |
| 239 |
+ |
|
| 239 | 240 |
docker start/running, process 2315 |
| 240 | 241 |
|
| 241 | 242 |
The procedure for starting the Docker daemon may differ depending on the |
| ... | ... |
@@ -249,6 +256,7 @@ daemon` at startup, or adding it to the `DOCKER_OPTS` line to the Docker config |
| 249 | 249 |
2. Verify the storage driver with the `docker info` command. |
| 250 | 250 |
|
| 251 | 251 |
$ sudo docker info |
| 252 |
+ |
|
| 252 | 253 |
Containers: 0 |
| 253 | 254 |
Images: 0 |
| 254 | 255 |
Storage Driver: btrfs |
| ... | ... |
@@ -182,6 +182,7 @@ You can detect the mode by viewing the `docker info` command: |
| 182 | 182 |
|
| 183 | 183 |
```bash |
| 184 | 184 |
$ sudo docker info |
| 185 |
+ |
|
| 185 | 186 |
Containers: 0 |
| 186 | 187 |
Images: 0 |
| 187 | 188 |
Storage Driver: devicemapper |
| ... | ... |
@@ -416,6 +417,7 @@ the specifics of the existing configuration use `docker info`: |
| 416 | 416 |
|
| 417 | 417 |
```bash |
| 418 | 418 |
$ sudo docker info |
| 419 |
+ |
|
| 419 | 420 |
Containers: 0 |
| 420 | 421 |
Running: 0 |
| 421 | 422 |
Paused: 0 |
| ... | ... |
@@ -453,6 +455,7 @@ The `Data Space` values show that the pool is 100GB total. This example extends |
| 453 | 453 |
|
| 454 | 454 |
```bash |
| 455 | 455 |
$ sudo ls -lh /var/lib/docker/devicemapper/devicemapper/ |
| 456 |
+ |
|
| 456 | 457 |
total 1175492 |
| 457 | 458 |
-rw------- 1 root root 100G Mar 30 05:22 data |
| 458 | 459 |
-rw------- 1 root root 2.0G Mar 31 11:17 metadata |
| ... | ... |
@@ -468,6 +471,7 @@ The `Data Space` values show that the pool is 100GB total. This example extends |
| 468 | 468 |
|
| 469 | 469 |
```bash |
| 470 | 470 |
$ sudo ls -lh /var/lib/docker/devicemapper/devicemapper/ |
| 471 |
+ |
|
| 471 | 472 |
total 1.2G |
| 472 | 473 |
-rw------- 1 root root 200G Apr 14 08:47 data |
| 473 | 474 |
-rw------- 1 root root 2.0G Apr 19 13:27 metadata |
| ... | ... |
@@ -477,9 +481,13 @@ The `Data Space` values show that the pool is 100GB total. This example extends |
| 477 | 477 |
|
| 478 | 478 |
```bash |
| 479 | 479 |
$ sudo blockdev --getsize64 /dev/loop0 |
| 480 |
+ |
|
| 480 | 481 |
107374182400 |
| 482 |
+ |
|
| 481 | 483 |
$ sudo losetup -c /dev/loop0 |
| 484 |
+ |
|
| 482 | 485 |
$ sudo blockdev --getsize64 /dev/loop0 |
| 486 |
+ |
|
| 483 | 487 |
214748364800 |
| 484 | 488 |
``` |
| 485 | 489 |
|
| ... | ... |
@@ -489,6 +497,7 @@ The `Data Space` values show that the pool is 100GB total. This example extends |
| 489 | 489 |
|
| 490 | 490 |
```bash |
| 491 | 491 |
$ sudo dmsetup status | grep pool |
| 492 |
+ |
|
| 492 | 493 |
docker-8:1-123141-pool: 0 209715200 thin-pool 91 |
| 493 | 494 |
422/524288 18338/1638400 - rw discard_passdown queue_if_no_space - |
| 494 | 495 |
``` |
| ... | ... |
@@ -499,6 +508,7 @@ The `Data Space` values show that the pool is 100GB total. This example extends |
| 499 | 499 |
|
| 500 | 500 |
```bash |
| 501 | 501 |
$ sudo dmsetup table docker-8:1-123141-pool |
| 502 |
+ |
|
| 502 | 503 |
0 209715200 thin-pool 7:1 7:0 128 32768 1 skip_block_zeroing |
| 503 | 504 |
``` |
| 504 | 505 |
|
| ... | ... |
@@ -540,6 +550,7 @@ disk partition. |
| 540 | 540 |
|
| 541 | 541 |
```bash |
| 542 | 542 |
$ sudo vgextend vg-docker /dev/sdh1 |
| 543 |
+ |
|
| 543 | 544 |
Volume group "vg-docker" successfully extended |
| 544 | 545 |
``` |
| 545 | 546 |
|
| ... | ... |
@@ -549,6 +560,7 @@ disk partition. |
| 549 | 549 |
|
| 550 | 550 |
```bash |
| 551 | 551 |
$ sudo lvextend -l+100%FREE -n vg-docker/data |
| 552 |
+ |
|
| 552 | 553 |
Extending logical volume data to 200 GiB |
| 553 | 554 |
Logical volume data successfully resized |
| 554 | 555 |
``` |
| ... | ... |
@@ -559,6 +571,7 @@ disk partition. |
| 559 | 559 |
|
| 560 | 560 |
```bash |
| 561 | 561 |
$ sudo dmsetup status | grep pool |
| 562 |
+ |
|
| 562 | 563 |
docker-253:17-1835016-pool: 0 96460800 thin-pool 51593 6270/1048576 701943/753600 - rw no_discard_passdown queue_if_no_space |
| 563 | 564 |
``` |
| 564 | 565 |
|
| ... | ... |
@@ -568,6 +581,7 @@ disk partition. |
| 568 | 568 |
|
| 569 | 569 |
```bash |
| 570 | 570 |
$ sudo dmsetup table docker-253:17-1835016-pool |
| 571 |
+ |
|
| 571 | 572 |
0 96460800 thin-pool 252:0 252:1 128 32768 1 skip_block_zeroing |
| 572 | 573 |
``` |
| 573 | 574 |
|
| ... | ... |
@@ -580,6 +594,7 @@ disk partition. |
| 580 | 580 |
|
| 581 | 581 |
```bash |
| 582 | 582 |
$ sudo blockdev --getsize64 /dev/vg-docker/data |
| 583 |
+ |
|
| 583 | 584 |
264132100096 |
| 584 | 585 |
``` |
| 585 | 586 |
|
| ... | ... |
@@ -101,6 +101,7 @@ single 8GB general purpose SSD EBS volume. The Docker data directory |
| 101 | 101 |
(`/var/lib/docker`) was consuming 2GB of space. |
| 102 | 102 |
|
| 103 | 103 |
$ docker images |
| 104 |
+ |
|
| 104 | 105 |
REPOSITORY TAG IMAGE ID CREATED SIZE |
| 105 | 106 |
jenkins latest 285c9f0f9d3d 17 hours ago 708.5 MB |
| 106 | 107 |
mysql latest d39c3fa09ced 8 days ago 360.3 MB |
| ... | ... |
@@ -111,9 +112,11 @@ single 8GB general purpose SSD EBS volume. The Docker data directory |
| 111 | 111 |
ubuntu 15.04 c8be1ac8145a 7 weeks ago 131.3 MB |
| 112 | 112 |
|
| 113 | 113 |
$ sudo du -hs /var/lib/docker |
| 114 |
+ |
|
| 114 | 115 |
2.0G /var/lib/docker |
| 115 | 116 |
|
| 116 | 117 |
$ time docker run --rm -v /var/lib/docker:/var/lib/docker docker/v1.10-migrator |
| 118 |
+ |
|
| 117 | 119 |
Unable to find image 'docker/v1.10-migrator:latest' locally |
| 118 | 120 |
latest: Pulling from docker/v1.10-migrator |
| 119 | 121 |
ed1f33c5883d: Pull complete |
| ... | ... |
@@ -203,6 +206,7 @@ images with `docker pull` and `docker push`. The command below pulls the |
| 203 | 203 |
`ubuntu:15.04` Docker image from Docker Hub. |
| 204 | 204 |
|
| 205 | 205 |
$ docker pull ubuntu:15.04 |
| 206 |
+ |
|
| 206 | 207 |
15.04: Pulling from library/ubuntu |
| 207 | 208 |
1ba8ac955b97: Pull complete |
| 208 | 209 |
f157c4e5ede7: Pull complete |
| ... | ... |
@@ -226,6 +230,7 @@ image being pulled from Docker Hub, followed by a directory listing on a host |
| 226 | 226 |
running version 1.9.1 of the Docker Engine. |
| 227 | 227 |
|
| 228 | 228 |
$ docker pull ubuntu:15.04 |
| 229 |
+ |
|
| 229 | 230 |
15.04: Pulling from library/ubuntu |
| 230 | 231 |
47984b517ca9: Pull complete |
| 231 | 232 |
df6e891a3ea9: Pull complete |
| ... | ... |
@@ -235,6 +240,7 @@ running version 1.9.1 of the Docker Engine. |
| 235 | 235 |
Status: Downloaded newer image for ubuntu:15.04 |
| 236 | 236 |
|
| 237 | 237 |
$ ls /var/lib/docker/aufs/layers |
| 238 |
+ |
|
| 238 | 239 |
47984b517ca9ca0312aced5c9698753ffa964c2015f2a5f18e5efa9848cf30e2 |
| 239 | 240 |
c8be1ac8145a6e59a55667f573883749ad66eaeef92b4df17e5ea1260e2d7356 |
| 240 | 241 |
df6e891a3ea9cdce2a388a2cf1b1711629557454fd120abd5be6d32329a0e0ac |
| ... | ... |
@@ -294,6 +300,7 @@ command. |
| 294 | 294 |
command: |
| 295 | 295 |
|
| 296 | 296 |
$ docker build -t changed-ubuntu . |
| 297 |
+ |
|
| 297 | 298 |
Sending build context to Docker daemon 2.048 kB |
| 298 | 299 |
Step 1 : FROM ubuntu:15.04 |
| 299 | 300 |
---> 3f7bcee56709 |
| ... | ... |
@@ -411,14 +418,23 @@ Let's see what happens if we spin up 5 containers based on our `changed-ubuntu` |
| 411 | 411 |
5 times. |
| 412 | 412 |
|
| 413 | 413 |
$ docker run -dit changed-ubuntu bash |
| 414 |
+ |
|
| 414 | 415 |
75bab0d54f3cf193cfdc3a86483466363f442fba30859f7dcd1b816b6ede82d4 |
| 416 |
+ |
|
| 415 | 417 |
$ docker run -dit changed-ubuntu bash |
| 418 |
+ |
|
| 416 | 419 |
9280e777d109e2eb4b13ab211553516124a3d4d4280a0edfc7abf75c59024d47 |
| 420 |
+ |
|
| 417 | 421 |
$ docker run -dit changed-ubuntu bash |
| 422 |
+ |
|
| 418 | 423 |
a651680bd6c2ef64902e154eeb8a064b85c9abf08ac46f922ad8dfc11bb5cd8a |
| 424 |
+ |
|
| 419 | 425 |
$ docker run -dit changed-ubuntu bash |
| 426 |
+ |
|
| 420 | 427 |
8eb24b3b2d246f225b24f2fca39625aaad71689c392a7b552b78baf264647373 |
| 428 |
+ |
|
| 421 | 429 |
$ docker run -dit changed-ubuntu bash |
| 430 |
+ |
|
| 422 | 431 |
0ad25d06bdf6fca0dedc38301b2aff7478b3e1ce3d1acd676573bba57cb1cfef |
| 423 | 432 |
|
| 424 | 433 |
This launches 5 containers based on the `changed-ubuntu` image. As each |
| ... | ... |
@@ -442,6 +458,7 @@ creating each container. |
| 442 | 442 |
3. List the contents of the local storage area. |
| 443 | 443 |
|
| 444 | 444 |
$ sudo ls /var/lib/docker/containers |
| 445 |
+ |
|
| 445 | 446 |
0ad25d06bdf6fca0dedc38301b2aff7478b3e1ce3d1acd676573bba57cb1cfef |
| 446 | 447 |
9280e777d109e2eb4b13ab211553516124a3d4d4280a0edfc7abf75c59024d47 |
| 447 | 448 |
75bab0d54f3cf193cfdc3a86483466363f442fba30859f7dcd1b816b6ede82d4 |
| ... | ... |
@@ -78,6 +78,7 @@ The following `docker pull` command shows a Docker host with downloading a |
| 78 | 78 |
Docker image comprising five layers. |
| 79 | 79 |
|
| 80 | 80 |
$ sudo docker pull ubuntu |
| 81 |
+ |
|
| 81 | 82 |
Using default tag: latest |
| 82 | 83 |
latest: Pulling from library/ubuntu |
| 83 | 84 |
|
| ... | ... |
@@ -98,6 +99,7 @@ layer IDs do not match the directory names in `/var/lib/docker/overlay`. This |
| 98 | 98 |
is normal behavior in Docker 1.10 and later. |
| 99 | 99 |
|
| 100 | 100 |
$ ls -l /var/lib/docker/overlay/ |
| 101 |
+ |
|
| 101 | 102 |
total 20 |
| 102 | 103 |
drwx------ 3 root root 4096 Jun 20 16:11 38f3ed2eac129654acef11c32670b534670c3a06e483fce313d72e3e0a15baa8 |
| 103 | 104 |
drwx------ 3 root root 4096 Jun 20 16:11 55f1e14c361b90570df46371b20ce6d480c434981cbda5fd68c6ff61aa0a5358 |
| ... | ... |
@@ -110,8 +112,11 @@ hard links to the data that is shared with lower layers. This allows for |
| 110 | 110 |
efficient use of disk space. |
| 111 | 111 |
|
| 112 | 112 |
$ ls -i /var/lib/docker/overlay/38f3ed2eac129654acef11c32670b534670c3a06e483fce313d72e3e0a15baa8/root/bin/ls |
| 113 |
+ |
|
| 113 | 114 |
19793696 /var/lib/docker/overlay/38f3ed2eac129654acef11c32670b534670c3a06e483fce313d72e3e0a15baa8/root/bin/ls |
| 115 |
+ |
|
| 114 | 116 |
$ ls -i /var/lib/docker/overlay/55f1e14c361b90570df46371b20ce6d480c434981cbda5fd68c6ff61aa0a5358/root/bin/ls |
| 117 |
+ |
|
| 115 | 118 |
19793696 /var/lib/docker/overlay/55f1e14c361b90570df46371b20ce6d480c434981cbda5fd68c6ff61aa0a5358/root/bin/ls |
| 116 | 119 |
|
| 117 | 120 |
Containers also exist on-disk in the Docker host's filesystem under |
| ... | ... |
@@ -120,6 +125,7 @@ container using the `ls -l` command, you find the following file and |
| 120 | 120 |
directories. |
| 121 | 121 |
|
| 122 | 122 |
$ ls -l /var/lib/docker/overlay/<directory-of-running-container> |
| 123 |
+ |
|
| 123 | 124 |
total 16 |
| 124 | 125 |
-rw-r--r-- 1 root root 64 Jun 20 16:39 lower-id |
| 125 | 126 |
drwxr-xr-x 1 root root 4096 Jun 20 16:39 merged |
| ... | ... |
@@ -131,6 +137,7 @@ file contains the ID of the top layer of the image the container is based on. |
| 131 | 131 |
This is used by OverlayFS as the "lowerdir". |
| 132 | 132 |
|
| 133 | 133 |
$ cat /var/lib/docker/overlay/ec444863a55a9f1ca2df72223d459c5d940a721b2288ff86a3f27be28b53be6c/lower-id |
| 134 |
+ |
|
| 134 | 135 |
55f1e14c361b90570df46371b20ce6d480c434981cbda5fd68c6ff61aa0a5358 |
| 135 | 136 |
|
| 136 | 137 |
The "upper" directory is the containers read-write layer. Any changes made to |
| ... | ... |
@@ -148,6 +155,7 @@ You can verify all of these constructs from the output of the `mount` command. |
| 148 | 148 |
(Ellipses and line breaks are used in the output below to enhance readability.) |
| 149 | 149 |
|
| 150 | 150 |
$ mount | grep overlay |
| 151 |
+ |
|
| 151 | 152 |
overlay on /var/lib/docker/overlay/ec444863a55a.../merged |
| 152 | 153 |
type overlay (rw,relatime,lowerdir=/var/lib/docker/overlay/55f1e14c361b.../root, |
| 153 | 154 |
upperdir=/var/lib/docker/overlay/ec444863a55a.../upper, |
| ... | ... |
@@ -170,6 +178,7 @@ After downloading a five-layer image using `docker pull ubuntu`, you can see |
| 170 | 170 |
six directories under `/var/lib/docker/overlay2`. |
| 171 | 171 |
|
| 172 | 172 |
$ ls -l /var/lib/docker/overlay2 |
| 173 |
+ |
|
| 173 | 174 |
total 24 |
| 174 | 175 |
drwx------ 5 root root 4096 Jun 20 07:36 223c2864175491657d238e2664251df13b63adb8d050924fd1bfcdb278b866f7 |
| 175 | 176 |
drwx------ 3 root root 4096 Jun 20 07:36 3a36935c9df35472229c57f4a27105a136f5e4dbef0f87905b2e506e494e348b |
| ... | ... |
@@ -183,6 +192,7 @@ shortened identifiers are used for avoid hitting the page size limitation on |
| 183 | 183 |
mount arguments. |
| 184 | 184 |
|
| 185 | 185 |
$ ls -l /var/lib/docker/overlay2/l |
| 186 |
+ |
|
| 186 | 187 |
total 20 |
| 187 | 188 |
lrwxrwxrwx 1 root root 72 Jun 20 07:36 6Y5IM2XC7TSNIJZZFLJCS6I4I4 -> ../3a36935c9df35472229c57f4a27105a136f5e4dbef0f87905b2e506e494e348b/diff |
| 188 | 189 |
lrwxrwxrwx 1 root root 72 Jun 20 07:36 B3WWEFKBG3PLLV737KZFIASSW7 -> ../4e9fa83caff3e8f4cc83693fa407a4a9fac9573deaf481506c102d484dd1e6a1/diff |
| ... | ... |
@@ -194,10 +204,15 @@ The lowerest layer contains the "link" file which contains the name of the short |
| 194 | 194 |
identifier, and the "diff" directory which contains the contents. |
| 195 | 195 |
|
| 196 | 196 |
$ ls /var/lib/docker/overlay2/3a36935c9df35472229c57f4a27105a136f5e4dbef0f87905b2e506e494e348b/ |
| 197 |
+ |
|
| 197 | 198 |
diff link |
| 199 |
+ |
|
| 198 | 200 |
$ cat /var/lib/docker/overlay2/3a36935c9df35472229c57f4a27105a136f5e4dbef0f87905b2e506e494e348b/link |
| 201 |
+ |
|
| 199 | 202 |
6Y5IM2XC7TSNIJZZFLJCS6I4I4 |
| 203 |
+ |
|
| 200 | 204 |
$ ls /var/lib/docker/overlay2/3a36935c9df35472229c57f4a27105a136f5e4dbef0f87905b2e506e494e348b/diff |
| 205 |
+ |
|
| 201 | 206 |
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var |
| 202 | 207 |
|
| 203 | 208 |
The second layer contains the "lower" file for denoting the layer composition, |
| ... | ... |
@@ -205,22 +220,30 @@ and the "diff" directory for the layer contents. It also contains the "merged" |
| 205 | 205 |
the "work" directories. |
| 206 | 206 |
|
| 207 | 207 |
$ ls /var/lib/docker/overlay2/223c2864175491657d238e2664251df13b63adb8d050924fd1bfcdb278b866f7 |
| 208 |
+ |
|
| 208 | 209 |
diff link lower merged work |
| 210 |
+ |
|
| 209 | 211 |
$ cat /var/lib/docker/overlay2/223c2864175491657d238e2664251df13b63adb8d050924fd1bfcdb278b866f7/lower |
| 212 |
+ |
|
| 210 | 213 |
l/6Y5IM2XC7TSNIJZZFLJCS6I4I4 |
| 214 |
+ |
|
| 211 | 215 |
$ ls /var/lib/docker/overlay2/223c2864175491657d238e2664251df13b63adb8d050924fd1bfcdb278b866f7/diff/ |
| 216 |
+ |
|
| 212 | 217 |
etc sbin usr var |
| 213 | 218 |
|
| 214 | 219 |
A directory for running container have similar files and directories as well. |
| 215 | 220 |
Note that the lower list is separated by ':', and ordered from highest layer to lower. |
| 216 | 221 |
|
| 217 | 222 |
$ ls -l /var/lib/docker/overlay/<directory-of-running-container> |
| 223 |
+ |
|
| 218 | 224 |
$ cat /var/lib/docker/overlay/<directory-of-running-container>/lower |
| 225 |
+ |
|
| 219 | 226 |
l/DJA75GUWHWG7EWICFYX54FIOVT:l/B3WWEFKBG3PLLV737KZFIASSW7:l/JEYMODZYFCZFYSDABYXD5MF6YO:l/UL2MW33MSE3Q5VYIKBRN4ZAGQP:l/NFYKDW6APBCCUCTOUSYDH4DXAT:l/6Y5IM2XC7TSNIJZZFLJCS6I4I4 |
| 220 | 227 |
|
| 221 | 228 |
The result of `mount` is as follows: |
| 222 | 229 |
|
| 223 | 230 |
$ mount | grep overlay |
| 231 |
+ |
|
| 224 | 232 |
overlay on /var/lib/docker/overlay2/9186877cdf386d0a3b016149cf30c208f326dca307529e646afce5b3f83f5304/merged |
| 225 | 233 |
type overlay (rw,relatime, |
| 226 | 234 |
lowerdir=l/DJA75GUWHWG7EWICFYX54FIOVT:l/B3WWEFKBG3PLLV737KZFIASSW7:l/JEYMODZYFCZFYSDABYXD5MF6YO:l/UL2MW33MSE3Q5VYIKBRN4ZAGQP:l/NFYKDW6APBCCUCTOUSYDH4DXAT:l/6Y5IM2XC7TSNIJZZFLJCS6I4I4, |
| ... | ... |
@@ -298,14 +321,17 @@ OverlayFS. The procedure assumes that the Docker daemon is in a stopped state. |
| 298 | 298 |
2. Verify your kernel version and that the overlay kernel module is loaded. |
| 299 | 299 |
|
| 300 | 300 |
$ uname -r |
| 301 |
+ |
|
| 301 | 302 |
3.19.0-21-generic |
| 302 | 303 |
|
| 303 | 304 |
$ lsmod | grep overlay |
| 305 |
+ |
|
| 304 | 306 |
overlay |
| 305 | 307 |
|
| 306 | 308 |
3. Start the Docker daemon with the `overlay`/`overlay2` storage driver. |
| 307 | 309 |
|
| 308 | 310 |
$ dockerd --storage-driver=overlay & |
| 311 |
+ |
|
| 309 | 312 |
[1] 29403 |
| 310 | 313 |
root@ip-10-0-0-174:/home/ubuntu# INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) |
| 311 | 314 |
INFO[0000] Option DefaultDriver: bridge |
| ... | ... |
@@ -321,6 +347,7 @@ OverlayFS. The procedure assumes that the Docker daemon is in a stopped state. |
| 321 | 321 |
4. Verify that the daemon is using the `overlay`/`overlay2` storage driver |
| 322 | 322 |
|
| 323 | 323 |
$ docker info |
| 324 |
+ |
|
| 324 | 325 |
Containers: 0 |
| 325 | 326 |
Images: 0 |
| 326 | 327 |
Storage Driver: overlay |
| ... | ... |
@@ -47,6 +47,7 @@ To find out which storage driver is set on the daemon, you use the |
| 47 | 47 |
`docker info` command: |
| 48 | 48 |
|
| 49 | 49 |
$ docker info |
| 50 |
+ |
|
| 50 | 51 |
Containers: 0 |
| 51 | 52 |
Images: 0 |
| 52 | 53 |
Storage Driver: overlay |
| ... | ... |
@@ -96,6 +97,7 @@ The following command shows how to start the Docker daemon with the |
| 96 | 96 |
$ dockerd --storage-driver=devicemapper & |
| 97 | 97 |
|
| 98 | 98 |
$ docker info |
| 99 |
+ |
|
| 99 | 100 |
Containers: 0 |
| 100 | 101 |
Images: 0 |
| 101 | 102 |
Storage Driver: devicemapper |
| ... | ... |
@@ -136,6 +136,7 @@ you should substitute your own values throughout the procedure. |
| 136 | 136 |
2. Install the `zfs` package. |
| 137 | 137 |
|
| 138 | 138 |
$ sudo apt-get install -y zfs |
| 139 |
+ |
|
| 139 | 140 |
Reading package lists... Done |
| 140 | 141 |
Building dependency tree |
| 141 | 142 |
<output truncated> |
| ... | ... |
@@ -143,6 +144,7 @@ you should substitute your own values throughout the procedure. |
| 143 | 143 |
3. Verify that the `zfs` module is loaded correctly. |
| 144 | 144 |
|
| 145 | 145 |
$ lsmod | grep zfs |
| 146 |
+ |
|
| 146 | 147 |
zfs 2813952 3 |
| 147 | 148 |
zunicode 331776 1 zfs |
| 148 | 149 |
zcommon 57344 1 zfs |
| ... | ... |
@@ -159,6 +161,7 @@ you should substitute your own values throughout the procedure. |
| 159 | 159 |
This is required for the `add-apt-repository` command. |
| 160 | 160 |
|
| 161 | 161 |
$ sudo apt-get install -y software-properties-common |
| 162 |
+ |
|
| 162 | 163 |
Reading package lists... Done |
| 163 | 164 |
Building dependency tree |
| 164 | 165 |
<output truncated> |
| ... | ... |
@@ -166,6 +169,7 @@ you should substitute your own values throughout the procedure. |
| 166 | 166 |
2. Add the `zfs-native` package archive. |
| 167 | 167 |
|
| 168 | 168 |
$ sudo add-apt-repository ppa:zfs-native/stable |
| 169 |
+ |
|
| 169 | 170 |
The native ZFS filesystem for Linux. Install the ubuntu-zfs package. |
| 170 | 171 |
<output truncated> |
| 171 | 172 |
gpg: key F6B0FC61: public key "Launchpad PPA for Native ZFS for Linux" imported |
| ... | ... |
@@ -177,6 +181,7 @@ you should substitute your own values throughout the procedure. |
| 177 | 177 |
archives. |
| 178 | 178 |
|
| 179 | 179 |
$ sudo apt-get update |
| 180 |
+ |
|
| 180 | 181 |
Ign http://us-west-2.ec2.archive.ubuntu.com trusty InRelease |
| 181 | 182 |
Get:1 http://us-west-2.ec2.archive.ubuntu.com trusty-updates InRelease [64.4 kB] |
| 182 | 183 |
<output truncated> |
| ... | ... |
@@ -186,6 +191,7 @@ archives. |
| 186 | 186 |
4. Install the `ubuntu-zfs` package. |
| 187 | 187 |
|
| 188 | 188 |
$ sudo apt-get install -y ubuntu-zfs |
| 189 |
+ |
|
| 189 | 190 |
Reading package lists... Done |
| 190 | 191 |
Building dependency tree |
| 191 | 192 |
<output truncated> |
| ... | ... |
@@ -197,6 +203,7 @@ archives. |
| 197 | 197 |
6. Verify that it loaded correctly. |
| 198 | 198 |
|
| 199 | 199 |
$ lsmod | grep zfs |
| 200 |
+ |
|
| 200 | 201 |
zfs 2768247 0 |
| 201 | 202 |
zunicode 331170 1 zfs |
| 202 | 203 |
zcommon 55411 1 zfs |
| ... | ... |
@@ -218,6 +225,7 @@ Once ZFS is installed and loaded, you're ready to configure ZFS for Docker. |
| 218 | 218 |
2. Check that the `zpool` exists. |
| 219 | 219 |
|
| 220 | 220 |
$ sudo zfs list |
| 221 |
+ |
|
| 221 | 222 |
NAME USED AVAIL REFER MOUNTPOINT |
| 222 | 223 |
zpool-docker 55K 3.84G 19K /zpool-docker |
| 223 | 224 |
|
| ... | ... |
@@ -228,6 +236,7 @@ Once ZFS is installed and loaded, you're ready to configure ZFS for Docker. |
| 228 | 228 |
4. Check that the previous step worked. |
| 229 | 229 |
|
| 230 | 230 |
$ sudo zfs list -t all |
| 231 |
+ |
|
| 231 | 232 |
NAME USED AVAIL REFER MOUNTPOINT |
| 232 | 233 |
zpool-docker 93.5K 3.84G 19K /zpool-docker |
| 233 | 234 |
zpool-docker/docker 19K 3.84G 19K /var/lib/docker |
| ... | ... |
@@ -238,6 +247,7 @@ Once ZFS is installed and loaded, you're ready to configure ZFS for Docker. |
| 238 | 238 |
5. Start the Docker daemon. |
| 239 | 239 |
|
| 240 | 240 |
$ sudo service docker start |
| 241 |
+ |
|
| 241 | 242 |
docker start/running, process 2315 |
| 242 | 243 |
|
| 243 | 244 |
The procedure for starting the Docker daemon may differ depending on the |
| ... | ... |
@@ -249,6 +259,7 @@ Once ZFS is installed and loaded, you're ready to configure ZFS for Docker. |
| 249 | 249 |
6. Verify that the daemon is using the `zfs` storage driver. |
| 250 | 250 |
|
| 251 | 251 |
$ sudo docker info |
| 252 |
+ |
|
| 252 | 253 |
Containers: 0 |
| 253 | 254 |
Images: 0 |
| 254 | 255 |
Storage Driver: zfs |