instruction: Create a Dockerfile for fundamentals
output: ```dockerfile
  from step 1, using the
  pvcreate command. Substitute your device name for /dev/xvdf.
  WarningThe next few steps are destructive, so be sure that you have specified
  the correct device.
  
  $ sudo pvcreate /dev/xvdf
  
  Physical volume "/dev/xvdf" successfully created.
  Create a docker volume group on the same device, using the vgcreate
  command.
  
  $ sudo vgcreate docker /dev/xvdf
  
  Volume group "docker" successfully created
  Create two logical volumes named thinpool and thinpoolmeta using the
  lvcreate command. The last parameter specifies the amount of free space
  to allow for automatic expanding of the data or metadata if space runs low,
  as a temporary stop-gap. These are the recommended values.
  
  $ sudo lvcreate --wipesignatures y -n thinpool docker -l 95%VG
  
  Logical volume "thinpool" created.
  
  $ sudo lvcreate --wipesignatures y -n thinpoolmeta docker -l 1%VG
  
  Logical volume "thinpoolmeta" created.
  Convert the volumes to a thin pool and a storage location for metadata for
  the thin pool, using the lvconvert command.
  
  $ sudo lvconvert -y \
  --zero n \
  -c 512K \
  --thinpool docker/thinpool \
  --poolmetadata docker/thinpoolmeta
  
  WARNING: Converting logical volume docker/thinpool and docker/thinpoolmeta to
  thin pool's data and metadata volumes with metadata wiping.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Converted docker/thinpool to thin pool.
  Configure autoextension of thin pools via an lvm profile.
  
  $ sudo vi /etc/lvm/profile/docker-thinpool.profile
  Specify thin_pool_autoextend_threshold and thin_pool_autoextend_percent
  values.thin_pool_autoextend_threshold is the percentage of space used before lvm
  attempts to autoextend the available space (100 = disabled, not recommended).thin_pool_autoextend_percent is the amount of space to add to the device
  when automatically extending (0 = disabled).The example below adds 20% more capacity when the disk usage reaches
  80%.
  
  activation {
   thin_pool_autoextend_threshold=80
   thin_pool_autoextend_percent=20
  }Save the file.Apply the LVM profile, using the lvchange command.
  
  $ sudo lvchange --metadataprofile docker-thinpool docker/thinpool
  
  Logical volume docker/thinpool changed.
  Ensure monitoring of the logical volume is enabled.
  
  $ sudo lvs -o+seg_monitor
  
  LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Monitor
  thinpool docker twi-a-t--- 95.00g 0.00 0.01 not monitored
  If the output in the Monitor column reports, as above, that the volume is
  not monitored, then monitoring needs to be explicitly enabled. Without
  this step, automatic extension of the logical volume will not occur,
  regardless of any settings in the applied profile.
  
  $ sudo lvchange --monitor y docker/thinpool
  Double check that monitoring is now enabled by running the
  sudo lvs -o+seg_monitor command a second time. The Monitor column
  should now report the logical volume is being monitored.If you have ever run Docker on this host before, or if /var/lib/docker/
  exists, move it out of the way so that Docker can use the new LVM pool to
  store the contents of image and containers.
  
  $ sudo su -
  # mkdir /var/lib/docker.bk
  # mv /var/lib/docker/* /var/lib/docker.bk
  # exit
  If any of the following steps fail and you need to restore, you can remove
  /var/lib/docker and replace it with /var/lib/docker.bk.Edit /etc/docker/daemon.json and configure the options needed for the
  devicemapper storage driver. If the file was previously empty, it should
  now contain the following contents:
  
  {
   "storage-driver": "devicemapper",
   "storage-opts": [
   "dm.thinpooldev=/dev/mapper/docker-thinpool",
   "dm.use_deferred_removal=true",
   "dm.use_deferred_deletion=true"
   ]
  }Start Docker.systemd:
  
  $ sudo systemctl start docker
  service:
  
  $ sudo service docker start
  Verify that Docker is using the new configuration using docker info.
  
  $ docker info
  
  Containers: 0
   Running: 0
   Paused: 0
   Stopped: 0
  Images: 0
  Server Version: 17.03.1-ce
  Storage Driver: devicemapper
   Pool Name: docker-thinpool
   Pool Blocksize: 524.3 kB
   Base Device Size: 10.74 GB
   Backing Filesystem: xfs
   Data file:
   Metadata file:
   Data Space Used: 19.92 MB
   Data Space Total: 102 GB
   Data Space Available: 102 GB
   Metadata Space Used: 147.5 kB
   Metadata Space Total: 1.07 GB
   Metadata Space Available: 1.069 GB
   Thin Pool Minimum Free Space: 10.2 GB
   Udev Sync Supported: true
   Deferred Removal Enabled: true
   Deferred Deletion Enabled: true
   Deferred Deleted Device Count: 0
   Library Version: 1.02.135-RHEL7 (2016-11-16)
  <...>
  If Docker is configured correctly, the Data file and Metadata file is
  blank, and the pool name is docker-thinpool.After you have verified that the configuration is correct, you can remove the
  /var/lib/docker.bk directory which contains the previous configuration.
  
  $ sudo rm -rf /var/lib/docker.bk
  Manage devicemapperMonitor the thin poolDo not rely on LVM auto-extension alone. The volume group
  automatically extends, but the volume can still fill up. You can monitor
  free space on the volume using lvs or lvs -a. Consider using a monitoring
  tool at the OS level, such as Nagios.To view the LVM logs, you can use journalctl:
  
  $ sudo journalctl -fu dm-event.service
  If you run into repeated problems with thin pool, you can set the storage option
  dm.min_free_space to a value (representing a percentage) in
  /etc/docker/daemon.json. For instance, setting it to 10 ensures
  that operations fail with a warning when the free space is at or near 10%.
  See the
  storage driver options in the Engine daemon reference.Increase capacity on a running deviceYou can increase the capacity of the pool on a running thin-pool device. This is
  useful if the data's logical volume is full and the volume group is at full
  capacity. The specific procedure depends on whether you are using a
  loop-lvm thin pool or a
  direct-lvm thin pool.Resize a loop-lvm thin poolThe easiest way to resize a loop-lvm thin pool is to
  use the device_tool utility,
  but you can use operating system utilities
  instead.Use the device_tool utilityA community-contributed script called device_tool.go is available in the
  moby/moby
  Github repository. You can use this tool to resize a loop-lvm thin pool,
  avoiding the long process above. This tool is not guaranteed to work, but you
  should only be using loop-lvm on non-production systems.If you do not want to use device_tool, you can resize the thin pool manually instead.To use the tool, clone the Github repository, change to the
  contrib/docker-device-tool, and follow the instructions in the README.md
  to compile the tool.Use the tool. The following example resizes the thin pool to 200GB.
  
  $ ./device_tool resize 200GB
  Use operating system utilitiesIf you do not want to use the device-tool utility,
  you can resize a loop-lvm thin pool manually using the following procedure.In loop-lvm mode, a loopback device is used to store the data, and another
  to store the metadata. loop-lvm mode is only supported for testing, because
  it has significant performance and stability drawbacks.If you are using loop-lvm mode, the output of docker info shows file
  paths for Data loop file and Metadata loop file:
  
  $ docker info |grep 'loop file'
  
   Data loop file: /var/lib/docker/devicemapper/data
   Metadata loop file: /var/lib/docker/devicemapper/metadata
  Follow these steps to increase the size of the thin pool. In this example, the
  thin pool is 100 GB, and is increased to 200 GB.List the sizes of the devices.
  
  $ sudo ls -lh /var/lib/docker/devicemapper/
  
  total 1175492
  -rw------- 1 root root 100G Mar 30 05:22 data
  -rw------- 1 root root 2.0G Mar 31 11:17 metadata
  Increase the size of the data file to 200 G using the truncate command,
  which is used to increase or decrease the size of a file. Note that
  decreasing the size is a destructive operation.
  
  $ sudo truncate -s 200G /var/lib/docker/devicemapper/data
  Verify the file size changed.
  
  $ sudo ls -lh /var/lib/docker/devicemapper/
  
  total 1.2G
  -rw------- 1 root root 200G Apr 14 08:47 data
  -rw------- 1 root root 2.0G Apr 19 13:27 metadata
  The loopback file has changed on disk but not in memory. List the size of
  the loopback device in memory, in GB. Reload it, then list the size again.
  After the reload, the size is 200 GB.
  
  $ echo $[ $(sudo blockdev --getsize64 /dev/loop0) / 1024 / 1024 / 1024 ]
  
  100
  
  $ sudo losetup -c /dev/loop0
  
  $ echo $[ $(sudo blockdev --getsize64 /dev/loop0) / 1024 / 1024 / 1024 ]
  
  200
  Reload the devicemapper thin pool.a. Get the pool name first. The pool name is the first field, delimited by
  :. This command extracts it.
  
  $ sudo dmsetup status | grep ' thin-pool ' | awk -F ': ' {'print $1'}
  docker-8:1-123141-pool
  b. Dump the device mapper table for the thin pool.
  
  $ sudo dmsetup table docker-8:1-123141-pool
  0 209715200 thin-pool 7:1 7:0 128 32768 1 skip_block_zeroing
  c. Calculate the total sectors of the thin pool using the second field
  of the output. The number is expressed in 512-k sectors. A 100G file has
  209715200 512-k sectors. If you double this number to 200G, you get
  419430400 512-k sectors.d. Reload the thin pool with the new sector number, using the following
  three dmsetup commands.
  
  $ sudo dmsetup suspend docker-8:1-123141-pool
  $ sudo dmsetup reload docker-8:1-123141-pool --table '0 419430400 thin-pool 7:1 7:0 128 32768 1 skip_block_zeroing'
  $ sudo dmsetup resume docker-8:1-123141-pool
  Resize a direct-lvm thin poolTo extend a direct-lvm thin pool, you need to first attach a new block device
  to the Docker host, and make note of the name assigned to it by the kernel. In
  this example, the new block device is /dev/xvdg.Follow this procedure to extend a direct-lvm thin pool, substituting your
  block device and other parameters to suit your situation.Gather information about your volume group.Use the pvdisplay command to find the physical block devices currently in
  use by your thin pool, and the volume group's name.
  
  $ sudo pvdisplay |grep 'VG Name'
  
  PV Name /dev/xvdf
  VG Name docker
  In the following steps, substitute your block device or volume group name as
  appropriate.Extend the volume group, using the vgextend command with the VG Name
  ```