Running (and debugging) iptables inside a Docker container

Sometimes there's a need to run iptables inside a Docker container. The most common scenario is probably when the container is attached not to a standard Docker bridge (which provides network connectivity using iptables) but to a network configured using macvlan or ipvlan driver. In that scenario the…

How to reduce Docker disk usage

Docker directory ( /var/lib/docker on Linux) tends to grow very big with time. There are two main reasons for it: 1. Container logs 2. Old images Clearing container logs By default the container logs are written to /var/lib/docker/CONTAINER_ID/CONTAINER_ID-json.log. In order to trim…

Using supervisord as the init process of a Docker container

There are many ways of building multi-process Docker container (by multi-process I mean the ones where there are multiple processes running simultaneously inside the container). Over time I found supervisord to be the easiest one to use to achieve good and reliable outcomes. This post describes the setup I use.…

Running Docker containers using IPv6

It's been over 20 years since IPv6 was first defined, but many applications and systems (Docker included) shy away from actively using it. Running Docker with IPv6 is not complicated, but requires certain preparations and a slightly deeper understanding of Docker networking. The main difference between running on…

Building multi-process Docker containers

Docker docs (https://docs.docker.com/config/containers/multi-service_container/) aren't as categoric as they once used to be when it comes to building multi-process containers, but doing so comes at a cost of additional complexity and potentially decreased reliability. Single process containers Let's start with…