https://github.com/projectatomic/container-storage-setup
Service to set up storage for Docker and other container systems
https://github.com/projectatomic/container-storage-setup
containers docker
Last synced: 24 days ago
JSON representation
Service to set up storage for Docker and other container systems
- Host: GitHub
- URL: https://github.com/projectatomic/container-storage-setup
- Owner: projectatomic
- License: apache-2.0
- Created: 2014-10-16T16:11:13.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-06-28T07:40:56.000Z (over 6 years ago)
- Last Synced: 2024-05-09T15:33:54.452Z (almost 2 years ago)
- Topics: containers, docker
- Language: Shell
- Homepage:
- Size: 471 KB
- Stars: 153
- Watchers: 26
- Forks: 82
- Open Issues: 48
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Container Storage Setup
## Tool for setting up container runtimes storage
`container-storage-setup` is part of the [Project Atomic](http://www.projectatomic.io/) suite of container projects, formerly known as docker-storage-setup.
A crucial aspect to container runtimes is the concept of the copy-on-write (COW) layered filesystems. The [Docker Engine Storage docs](https://docs.docker.com/engine/userguide/storagedriver/) site explains how the docker daemon uses uses COW file systems
`container-storage-setup` is a script to configure COW File systems like devicemapper and overlayfs. It is usually run via a systemd service. For example `docker-storage-setup.service`, runs `container-storage-setup` before the docker.service script starts the docker daemon.
The `container-storage-service` script takes an input file and an output file as parameters. The input file is usually provided by the distribution and
is expected to be modified by administrators. The script generates the specified output file as a configuration file bash script which sets environment variables to be used by the container runtime service script.
For example if I configured an runtime-storage-setup to look like
```
cat /etc/sysconfig/runtime-storage-setup
STORAGE_DRIVER="overlay2"
```
If I then executed
```
container-storage-setup /etc/sysconfig/runtime-storage-setup /etc/sysconfig/runtime-storage
```
I will end up with a runtime storage file which looks like.
```
cat /etc/sysconfig/runtime-storage
STORAGE_OPTIONS="--storage-driver overlay2 "
```
The service script of the container runtime should have something like
```
EnvironmentFile=-/etc/sysconfig/runtime-storage
...
ExecStart=/usr/bin/container-runtime $STORAGE_OPTIONS
...
```
Obviously the container runtime must handle the --storage-driver option.
NOTE: `container-storage-setup` has legacy support for docker-storage-setup. If you execute the script without specifying an input file and and output file, it will default to an input file of `/etc/sysconfig/docker-storage-setup` and an output file of `/etc/sysconfig/docker-storage`. The Environment name in the output file will be set to DOCKER_STORAGE_OPTIONS.
```
cat /etc/sysconfig/docker-storage-setup
STORAGE_DRIVER="overlay2"
```
If I then executed
```
container-storage-setup
```
I will end up with a runtime storage file which looks like.
```
cat /etc/sysconfig/docker-storage
DOCKER_STORAGE_OPTIONS="--storage-driver overlay2 "
```
#### Input File
The input file should be setup by distributions or by the packagers of the
container runtimes. The contents can also be set during system
bootstrap, e.g. in a `cloud-init` `bootcmd:` hook, or via
kickstart `%post`.
For more information on configuration, see
[man container-storage-setup](container-storage-setup.1).