aboutsummaryrefslogtreecommitdiffstats
path: root/node-admin/README_LINUX.md
blob: 56c1fb60a7ef1e334577782ded9f0c8d1fb58d16 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Setting up Docker on a linux machine

First, install Docker. With Fedora 21 you should follow
https://docs.docker.com/engine/installation/linux/fedora/, which describes how to install
Docker.

## Configuring Docker
 
Docker will by default download (huge) images to a directory under `/var`. On our
Fedora machines, `/var` is part of the root filesystem, which does not have a lot
of free space. Since docker runs as `root`, it is allowed to completely fill up
the filesystem, and it will happily do so. Fedora works very poorly with a full
root filesystem. You won't even be able to log in and clean up the disk usage
once it's happened.

So you'll want to store images somewhere else. An obvious choice is `/home`,
which typically has a lot more room. Make Docker use directories in the docker
user's home directory, set the `--graph` option by editing 
`/etc/systemd/system/docker.service.d/docker.conf` to:

```
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd \
        --debug \
        --graph=/home/docker/data \
        --host=127.0.0.1:2376 \
        --host=unix:///var/run/docker.sock \
        --selinux-enabled \
        --storage-driver=devicemapper \
        --storage-opt=dm.basesize=20G
```

Finally, start docker:
```
sudo systemctl start docker
```



## Other

For more information on how to configure the docker daemon, see https://docs.docker.com/engine/admin/systemd/.

## Upgrade of Docker

When Docker upgrades it may overwrite /lib/systemd/system/docker.service. The
symptom is that any docker command will fail with the error message "Cannot
connect to the Docker daemon. Is the docker daemon running on this host?".

Once you have updated docker.service according to this document, and restarted
the Docker daemon, Docker should work again.