Skip to content

Commit b12ec60

Browse files
author
Misty Stanley-Jones
authored
Storage driver followup (docker#3386)
* Fix picky formatting errors * Address post-merge feedback * Changing the storage driver on D4M/D4W not supported
1 parent 4fb8fce commit b12ec60

File tree

7 files changed

+70
-137
lines changed

7 files changed

+70
-137
lines changed

engine/installation/linux/suse.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,12 @@ the repository.
180180
$ sudo zypper install docker-ee-<VERSION_STRING>
181181
```
182182
183-
4. Configure Docker to use the `btrfs` filesystem. Edit the file
184-
`/etc/docker/daemon.json` (create it if it does not exist) and add the
185-
following contents:
183+
4. Configure Docker to use the `btrfs` filesystem. **This is only required if
184+
the `/` filesystem is not using BTRFS.** However, explicitly specifying the
185+
`storage-driver` has no harmful side effects.
186+
187+
Edit the file `/etc/docker/daemon.json` (create it if it does not exist) and
188+
add the following contents:
186189
187190
```json
188191
{
@@ -243,9 +246,12 @@ need to download a new file each time you want to upgrade Docker.
243246
$ sudo zypper install /path/to/package.rpm
244247
```
245248

246-
4. Configure Docker to use the `btrfs` filesystem. Edit the file
247-
`/etc/docker/daemon.json` (create it if it does not exist) and add the
248-
following contents:
249+
4. Configure Docker to use the `btrfs` filesystem. **This is only required if
250+
the `/` filesystem is not using BTRFS.** However, explicitly specifying the
251+
`storage-driver` has no harmful side effects.
252+
253+
Edit the file `/etc/docker/daemon.json` (create it if it does not exist) and
254+
add the following contents:
249255

250256
```json
251257
{

engine/userguide/storagedriver/aufs-driver.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,11 @@ storage driver is configured, Docker uses it by default.
6464
<truncated output>
6565
```
6666

67-
3. If you are using a different storage driver, then it means that either AUFS
68-
is not included in the kernel (in which case a different default driver will
69-
be used) or that means that Docker has been explicitly configured to use a
70-
different driver. Check `/etc/docker/daemon.json` or the output of
71-
`ps auxw |grep dockerd` to see if Docker has been started with the
72-
`--storage-driver` flag.
67+
3. If you are using a different storage driver, either AUFS is not included in
68+
the kernel (in which case a different default driver will be used) or that
69+
Docker has been explicitly configured to use a different driver. Check
70+
`/etc/docker/daemon.json` or the output of `ps auxw | grep dockerd` to see
71+
if Docker has been started with the `--storage-driver` flag.
7372

7473

7574
## How the `aufs` storage driver works
@@ -112,6 +111,9 @@ Status: Downloaded newer image for ubuntu:latest
112111

113112
#### The image layers
114113

114+
> **Warning**: Do not directly manipulate any files or directories within
115+
> `/var/lib/docker/`. These files and directories are managed by Docker.
116+
115117
All of the information about the image and container layers is stored in
116118
subdirectories of `/var/lib/docker/aufs/`.
117119

@@ -129,10 +131,6 @@ subdirectories of `/var/lib/docker/aufs/`.
129131
If a container is running, the contents of `/var/lib/docker/aufs/` change in the
130132
following ways:
131133

132-
> **Note**: If you see files or directories which end in `-init`, these are used
133-
> to prepare the container to use bind mounts, and should be considered an
134-
> implementation detail.
135-
136134
- `diff/`: Differences introduced in the writable container layer, such as new
137135
or modified files.
138136
- `layers/`: Metadata about the writable container layer's parent layers.

engine/userguide/storagedriver/device-mapper-driver.md

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,16 @@ assumes that the Docker daemon is in the `stopped` state.
203203
the thin pool, using the `lgconvert` command.
204204

205205
```none
206-
$ sudo lvconvert -y \
207-
--zero n \
208-
-c 512K \
209-
--thinpool docker/thinpool \
210-
--poolmetadata docker/thinpoolmeta
211-
212-
WARNING: Converting logical volume docker/thinpool and docker/thinpoolmeta to thin pool's data and metadata volumes with metadata wiping.
213-
THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
214-
Converted docker/thinpool to thin pool.
215-
```
206+
$ sudo lvconvert -y \
207+
--zero n \
208+
-c 512K \
209+
--thinpool docker/thinpool \
210+
--poolmetadata docker/thinpoolmeta
211+
212+
WARNING: Converting logical volume docker/thinpool and docker/thinpoolmeta to thin pool's data and metadata volumes with metadata wiping.
213+
THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
214+
Converted docker/thinpool to thin pool.
215+
```
216216

217217
8. Create an LVM profile that will enable automatic extension of the thin
218218
pool. Edit the file `/etc/lvm/profile/docker-thinpool.profile` and add the
@@ -247,12 +247,12 @@ assumes that the Docker daemon is in the `stopped` state.
247247
The example below will add 20% more capacity when the disk usage reaches
248248
80%.
249249

250-
```none
251-
activation {
252-
thin_pool_autoextend_threshold=80
253-
thin_pool_autoextend_percent=20
254-
}
255-
```
250+
```none
251+
activation {
252+
thin_pool_autoextend_threshold=80
253+
thin_pool_autoextend_percent=20
254+
}
255+
```
256256

257257
Save the file.
258258

@@ -303,7 +303,7 @@ assumes that the Docker daemon is in the `stopped` state.
303303

304304
13. Start Docker.
305305

306-
**systemd**:
306+
**systemd**:
307307

308308
```bash
309309
$ sudo systemctl start docker
@@ -487,19 +487,15 @@ thin pool is 100 GB, and is increased to 200 GB.
487487
a. Get the pool name first. The pool name is the first field, delimited by
488488
` :`. This command extracts it.
489489

490-
```bash
491-
$ sudo dmsetup status | grep ' thin-pool ' | awk -F ': ' {'print $1'}
490+
$ sudo dmsetup status | grep ' thin-pool ' | awk -F ': ' {'print $1'}
492491

493-
docker-8:1-123141-pool
494-
```
492+
docker-8:1-123141-pool
495493

496494
b. Dump the device mapper table for the thin pool.
497495

498-
```bash
499-
$ sudo dmsetup table docker-8:1-123141-pool
496+
$ sudo dmsetup table docker-8:1-123141-pool
500497

501-
0 209715200 thin-pool 7:1 7:0 128 32768 1 skip_block_zeroing
502-
```
498+
0 209715200 thin-pool 7:1 7:0 128 32768 1 skip_block_zeroing
503499

504500
c. Calculate the total sectors of the thin pool using the second field
505501
of the output. The number is expressed in 512-k sectors. A 100G file has
@@ -509,13 +505,12 @@ thin pool is 100 GB, and is increased to 200 GB.
509505
d. Reload the thin pool with the new sector number, using the following
510506
three `dmsetup` commands.
511507

512-
```bash
513-
$ sudo dmsetup suspend docker-8:1-123141-pool
508+
$ sudo dmsetup suspend docker-8:1-123141-pool
509+
510+
$ sudo dmsetup reload docker-8:1-123141-pool --table '0 419430400 thin-pool 7:1 7:0 128 32768 1 skip_block_zeroing'
514511

515-
$ sudo dmsetup reload docker-8:1-123141-pool --table '0 419430400 thin-pool 7:1 7:0 128 32768 1 skip_block_zeroing'
512+
$ sudo dmsetup resume docker-8:1-123141-pool
516513

517-
$ sudo dmsetup resume docker-8:1-123141-pool
518-
```
519514

520515
#### Resize a direct-lvm thin pool
521516

engine/userguide/storagedriver/imagesandcontainers.md

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -43,69 +43,12 @@ new files, modifying existing files, and deleting files, are written to this thi
4343
writable container layer. The diagram below shows a container based on the Ubuntu
4444
15.04 image.
4545

46-
The diagram below shows a container with the Ubuntu 15.04 image comprising 4
47-
stacked image layers, and the writable container layer on top.
48-
4946
![Docker image layers](images/container-layers.jpg)
5047

5148
A _storage driver_ handles the details about the way these layers interact with
5249
each other. Different storage drivers are available, which have advantages
5350
and disadvantages in different situations.
5451

55-
### Content addressable storage
56-
57-
If you are already running Docker 1.10 or higher, you can skip this section and
58-
go straight to [Containers and layers](#containers-and-layers).
59-
60-
Docker 1.10 introduced a new content addressable storage model. This is a
61-
completely new way to address image and layer data on disk. Previously, image
62-
and layer data was referenced and stored using a randomly generated UUID. In
63-
the new model this is replaced by a secure *content hash*.
64-
65-
The new model improves security, provides a built-in way to avoid ID
66-
collisions, and guarantees data integrity after pull, push, load, and save
67-
operations. It also enables better sharing of layers by allowing many images to
68-
freely share their layers even if they didn’t come from the same build.
69-
70-
The diagram below shows an updated version of the previous diagram,
71-
highlighting the changes implemented by Docker 1.10.
72-
73-
![](images/container-layers-cas.jpg)
74-
75-
All image layer IDs are cryptographic hashes, whereas the container ID is still
76-
a randomly generated UUID.
77-
78-
The new model requires you to migrate existing images from Docker 1.9 and
79-
earlier, and it includes several changes to the filesystem structure of images
80-
and layers. If you are already running Docker 1.10 or higher, you can skip this
81-
section.
82-
83-
Images created within Docker 1.9 or earlier need to be migrated before they can
84-
be used with the new model. This migration involves calculating new secure
85-
checksums and is performed automatically the first time you start an updated
86-
Docker daemon. After the migration is complete, all images and tags will have
87-
brand new secure IDs.
88-
89-
Although the migration is automatic and transparent, it is computationally
90-
intensive. It may take some time to complete, and during this time, Docker will
91-
not respond to other requests. If this is a problem, you can use a
92-
[migration tool](https://github.com/docker/v1.10-migrator/releases) to migrate
93-
existing images to the new format before upgrading Docker. This avoids
94-
downtime and allows you to distribute migrated images to systems that have
95-
already been upgraded. For more information, see
96-
[https://github.com/docker/v1.10-migrator/releases](https://github.com/docker/v1.10-migrator/releases).
97-
98-
During the migration, you need to expose your Docker host's data directory to
99-
the migration container. If you are using the default Docker data path, use a
100-
command like the following:
101-
102-
```bash
103-
$ sudo docker run --rm -v /var/lib/docker:/var/lib/docker docker/v1.10-migrator
104-
```
105-
106-
If you use the `devicemapper` storage driver, you need to include the
107-
`--privileged` option so that the container has access to your storage devices.
108-
10952
## Container and layers
11053

11154
The major difference between a container and an image is the top writable layer.

engine/userguide/storagedriver/overlayfs-driver.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -484,19 +484,19 @@ The following generic performance best practices also apply to OverlayFS.
484484
To summarize the OverlayFS's aspect which is incompatible with other
485485
filesystems:
486486

487-
- **open(2)**. OverlayFS only implements a subset of the POSIX standards.
488-
This can result in certain OverlayFS operations breaking POSIX standards. One
489-
such operation is the *copy-up* operation. Suppose that your application calls
490-
`fd1=open("foo", O_RDONLY)` and then `fd2=open("foo", O_RDWR)`. In this case,
491-
your application expects `fd1` and `fd2` to refer to the same file. However, due
492-
to a copy-up operation that occurs after the first calling to `open(2)`, the
493-
descriptors refer to different files.
494-
495-
`yum` is known to be affected unless the `yum-plugin-ovl` package is installed.
496-
If the `yum-plugin-ovl` package is not available in your distribution (e.g.
497-
RHEL/CentOS prior to 6.8 or 7.2), you may need to run `touch /var/lib/rpm/*`
498-
before running `yum install`.
499-
500-
- **rename(2)**. OverlayFS does not fully support the `rename(2)` system call.
501-
Your application needs to detect its failure and fall back to a "copy and
502-
unlink" strategy.
487+
- **open(2)**: OverlayFS only implements a subset of the POSIX standards.
488+
This can result in certain OverlayFS operations breaking POSIX standards. One
489+
such operation is the *copy-up* operation. Suppose that your application calls
490+
`fd1=open("foo", O_RDONLY)` and then `fd2=open("foo", O_RDWR)`. In this case,
491+
your application expects `fd1` and `fd2` to refer to the same file. However, due
492+
to a copy-up operation that occurs after the first calling to `open(2)`, the
493+
descriptors refer to different files.
494+
495+
`yum` is known to be affected unless the `yum-plugin-ovl` package is installed.
496+
If the `yum-plugin-ovl` package is not available in your distribution (e.g.
497+
RHEL/CentOS prior to 6.8 or 7.2), you may need to run `touch /var/lib/rpm/*`
498+
before running `yum install`.
499+
500+
- **rename(2)**: OverlayFS does not fully support the `rename(2)` system call.
501+
Your application needs to detect its failure and fall back to a "copy and
502+
unlink" strategy.

engine/userguide/storagedriver/selectadriver.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ to the container's writable layer.
9898

9999
### Docker for Mac and Docker for Windows
100100

101-
Docker for Mac and Docker for Windows only support `overlay2` `aufs`, or
102-
`overlay`. However, `overlay` is not recommended. `aufs` is the default in
103-
stable releases and `overlay2` is the default in Edge releases. In addition,
101+
Docker for Mac and Docker for Windows are intended for development, rather
102+
than production. Modifying the storage driver on these platforms is not
103+
supported.
104104

105105
## Supported backing filesystems
106106

@@ -149,7 +149,7 @@ Each Docker storage driver is based on a Linux filesystem or volume manager. Be
149149
sure to follow existing best practices for operating your storage driver
150150
(filesystem or volume manager) on top of your shared storage system. For
151151
example, if using the ZFS storage driver on top of a shared storage system, be
152-
sure to follow best practices for operating aZFS filesystems on top of that
152+
sure to follow best practices for operating ZFS filesystems on top of that
153153
specific shared storage system.
154154

155155
### Stability
@@ -198,9 +198,8 @@ Storage Driver: overlay
198198

199199
To set the storage driver, set the option in the `daemon.json`
200200
file, which is located in `/etc/docker/` on Linux and
201-
`C:\ProgramData\docker\config\` on Windows Server. If you use Docker for Mac or
202-
Docker for Windows, click the Docker icon, choose **Preferences**, and choose
203-
**Daemon** on Docker for Mac or Docker for Windows.
201+
`C:\ProgramData\docker\config\` on Windows Server. Changing the storage driver
202+
on Docker for Mac or Docker for Windows is not supported.
204203

205204
If the `daemon.json` file does not exist, create it. Assuming there are no other
206205
settings in the file, it should have the following contents:
@@ -216,14 +215,6 @@ You can specify any valid storage driver in place of `devicemapper`.
216215
Restart Docker for the changes to take effect. After restarting, run
217216
`docker info` again to verify that the new storage driver is being used.
218217

219-
### Extra steps for Docker for Mac or Docker for Windows
220-
221-
Before you change the default storage driver on Docker for Mac or Docker for
222-
Windows, it is recommended to do a factory reset to wipe the old storage
223-
location, since you will not be able to access it after you change the storage
224-
driver. If you need to save any containers, use `docker save` before doing the
225-
reset.
226-
227218
## Related information
228219

229220
* [About images, containers, and storage drivers](imagesandcontainers.md)

engine/userguide/storagedriver/zfs-driver.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ use unless you have substantial experience with ZFS on Linux.
8787

8888
Save and close the file.
8989

90-
4. Start docker. Use `docker info` to verify that the storage driver is `zfs`.
90+
4. Start Docker. Use `docker info` to verify that the storage driver is `zfs`.
9191

9292
```bash
9393
$ sudo docker info
@@ -105,8 +105,8 @@ use unless you have substantial experience with ZFS on Linux.
105105
Space Available: 103498395648
106106
Parent Quota: no
107107
Compression: off
108-
<output truncated>
109-
```
108+
<output truncated>
109+
```
110110

111111
## Manage `zfs`
112112

0 commit comments

Comments
 (0)