A new personal computer or server must be setup with a Debian OS and Docker must be installed. The Docker services from an old PC moving to the new one.

Setup and install

Installation

First add the apt sources from the Docker repositories and install Docker according to this guide. For managing the Docker engine in a convenient way on a Debian Desktop machine, take the following considerations into account.

Docker user

For non-privileged user to run docker commands follow this guide.

Systemctl

The systemctl unit docker.service must be modified to run the docker daemon without arguments. Alternatively, the arguments are written in /etc/docker/daemon.json which is recognized on systemctl startup. For this, the file /etc/systemd/system/docker.service.d/override.conf must be created with the following content:

[Service]
 ExecStart=
 ExecStart=/usr/bin/dockerd

Daemon settings

For having acces via the local unix socket or the local IP/port combination, the following content must be filled into /etc/docker/daemon.json:

{
    "hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]
}

The systemctl daemon must be reloaded and the docker daemon must be restarted:

systemctl daemon-reload
systemctl restart docker.service

If all things are done, test the funtionality of Docker with the following command as user:

docker run hello-world

Docker daemon socket access

The running Docker instance can be accessed via the local Unix socket or via HTTP(S). For HTTPS a certification is necessary described in here

Managing Docker

Docker shell extension for Gnome

For having a quick way to access Docker running containers and images, the Gnome shell extension here is very handy to to this from your Gnome desktop.

Portainer

A full management tool is Portainer, which runs as a container itself. It can be deployed by docker-compose:

myportainer:
    image: portainer/portainer-ce:latest
    container_name: portainer
    ports:
      - "9000:9000"
      - "8000:8000" 
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - portainer_data:/data

The webinterface is accessible via localhost:9000.

Docker container with IPv6

This is a brief howto of this guide. Per default containers are started only with IPv4 addresses. To let Docker also assign IPv6 addresses to the containers, the /etc/docker/daemon.json must be modified:

{
  "experimental": true,
  "ip6tables": true
}

Restart the Docker daemon with sudo systemctl restart docker. Additional modifications in the docker-compose.yml in the networking sections are necessary.