dotcloud/docker — pull request #5141 by madhatter (2014-04-10 12:48:21+00:00)
Title: Enhanced Systemd Unit File to use /etc/default/docker if available

As there are no other possibilities to change or set docker's behaviour when the daemon starts, I used the `/etc/default/docker` file which lies in `./contrib/init/sysvinit-debian` and added the `EnvironmentFile` to the unit file in `./contrib/init/systemd`. The `=-` ensures that no error messages is generated if the environment file does not exist.
Then I added `$DOCKER_OPTS` to the execution command for the docker daemon to use the options set in `/etc/default/docker`.

So I have been able to modify the path to use as the root of the docker runtime by setting `DOCKER_OPTS="-g /export/storage/docker"`:

```
~ $ sudo docker info
Containers: 3
Images: 52
Storage Driver: devicemapper
Pool Name: docker-0:41-24-pool
Data file: /export/storage/docker/devicemapper/devicemapper/data
Metadata file: /export/storage/docker/devicemapper/devicemapper/metadata
Data Space Used: 3313.2 Mb
Data Space Total: 102400.0 Mb
Metadata Space Used: 5.2 Mb
Metadata Space Total: 2048.0 Mb
Execution Driver: native-0.1
Kernel Version: 3.13.8-1-ARCH
Username: madhatter
Registry: [https://index.docker.io/v1/]
```