Docker

Official documentation
Docker hub image register

Docker installation. From the Official tutorial:

Docker compose

Docker Compose is a tool that allow to easily configure and run one or multiple containers based on a yaml file (docker-compose.yml).

Docker compose is now integrated in docker (installed by the docker-compose-plugin package that should be automatically installed alongside docker).
That means that you should now use docker compose instead of docker-compose (see the migration overview.

Compose file reference.
When you write a compose file, you can test its syntax by running docker-compose config. Note that in yaml indentation matters and must be done with spaces.

Allow inter-container communication in firewall

In general, containers on the same network can communicate between them without problems. If a container exposes a port, outside hosts can also communicate with the container without problems.
However sometimes when two containers try to communicate using a public name (e.g. service.example.org), the firewall blocks the communication, even though the destination container exposes the port.

A solution is to explicitly open the port in the firewall, e.g. for https iptables -A INPUT -p tcp --dport 443 -j ACCEPT.

Backing up docker volumes

Creating an archive of the volume

Restoring a volume form an archive

Bug: docker won't remove containers

Based on this github comment.

If when you try to remove a container it fails with error: driver "aufs" failed to remove root filesystem for [...] device or resource busy, you can fix it like this.

Useful images

Busybox

Docker hub page

Very minimalist linux container, useful for troubleshooting docker setups.

If you want to start the container and leave it running (e.g. in order to attach to it afterwards), you can run a command like sh -c 'tail -f /dev/null', which will never end.

Nginx

Docker hub page

Web server. Easy to use in order to create a container serving web content. The content to serve must be in the /usr/share/nginx/html folder in the container.

Glances

Docker hub page

Monitoring application that can also monitor docker containers.

If the display gets broken press h to access the help and then press h again to get back, this refreshes the display.

Run GUI applications with VNC

Since containers typically do not have access to a screen, gui applications can usually not be run in them. A solution to this is to create a virtual display and expose it with vnc.

On a debian container/system you would do the following steps:

On the system from which you intend to connect: