Skip to content

Running Docker in a "node" VM

Rocky Craig edited this page Feb 28, 2018 · 2 revisions

Docker is installed on the emulation images by the install script. When a virtual machine created by the install script is booted, Docker will automatically be started by systemd.

HTTP proxy configuration

If a HTTP proxy is required to access the Internet from the host running the virtual machines, this will need to be configured in systemd for the Docker server. To do this a systemd configuration fragment should be created. Fragments are the preferred way of modifying systemd unit files especially if the root partition is read-only.

Execute the following commands to configure a HTTP proxy for the Docker server:

$ sudo mkdir -p /etc/systemd/system/docker.service.d
$ cat > /tmp/http-proxy.conf << EOF
[Service]
Environment="HTTP_PROXY=http://proxy.bigcorp.com:8080"
Environment="HTTPS_PROXY=http://proxy.bigcorp.com:8080"
Environment="NO_PROXY=127.0.0.1,localhost"
EOF
$ sudo mv /tmp/httpd-proxy.conf /etc/systemd/system/docker.service.d
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker

Please note that the previous well-known place for modifying the environment of the Docker daemon, /etc/default/docker, is no longer used.

Running as non-root

By default only the root user or a member of the docker UNIX group may connect to the Docker server. To add the l4tm user to the docker UNIX group run the following command:

$ sudo usermod -a -G docker l4tm

The l4tm user must be logged out and logged in again for the new group membership to take effect.