|
| 1 | +## Devmapper snapshotter |
| 2 | + |
| 3 | +Devmapper is a `containerd` snapshotter plugin that stores snapshots in ext4-formatted filesystem images |
| 4 | +in a devicemapper thin pool. |
| 5 | + |
| 6 | +## Setup |
| 7 | + |
| 8 | +To make it work you need to prepare `thin-pool` in advance and update containerd's configuration file. |
| 9 | +This file is typically located at `/etc/containerd/config.toml`. |
| 10 | + |
| 11 | +Here's minimal sample entry that can be made in the configuration file: |
| 12 | + |
| 13 | +``` |
| 14 | +[plugins] |
| 15 | + ... |
| 16 | + [plugins.devmapper] |
| 17 | + pool_name = "containerd-pool" |
| 18 | + base_image_size = "128MB" |
| 19 | + ... |
| 20 | +``` |
| 21 | + |
| 22 | +The following configuration flags are supported: |
| 23 | +* `root_path` - a directory where the metadata will be available (if empty |
| 24 | + default location for `containerd` plugins will be used) |
| 25 | +* `pool_name` - a name to use for the devicemapper thin pool. Pool name |
| 26 | + should be the same as in `/dev/mapper/` directory |
| 27 | +* `data_device` - path to the data volume that should be used by the thin pool |
| 28 | +* `meta_device` - path to the metadata volume that should be used by the thin-pool |
| 29 | +* `data_block_size` - the size of allocation chunks in data file, between 128 |
| 30 | + sectors (64KB) and and 2097152 sectors (1GB) and a multiple of 128 sectors (64KB) |
| 31 | +* `base_image_size` - defines how much space to allocate when creating the base device |
| 32 | + |
| 33 | +Pool name and base image size are required snapshotter parameters. |
| 34 | + |
| 35 | +## Run |
| 36 | +Give it a try with the following commands: |
| 37 | + |
| 38 | +```bash |
| 39 | +ctr images pull --snapshotter devmapper docker.io/library/hello-world:latest |
| 40 | +ctr run --snapshotter devmapper docker.io/library/hello-world:latest test |
| 41 | +``` |
| 42 | + |
| 43 | +## Requirements |
| 44 | + |
| 45 | +The devicemapper snapshotter requires `dmsetup` command line tool to be installed and available on your computer. |
| 46 | +On Ubuntu, it can be installed with `apt-get install dmsetup` command. |
0 commit comments