Move the docker data directory

The default location for the docker data directory, when using overlay2 storage driver is /var/lib/docker. Maybe you want to move it to another location, and it’s actually pretty easy. Stop the docker service: sudo systemctl stop docker.service Copy the docker folder to the new location:sudo cp -rp /var/lib/docker /path/to/new/locationThe p in -rp will preserve ownership,…

Continue Reading

Postgresql not listening on docker interface after reboot

/etc/postgresql/12/main/postgresql.conf is where you define the interfaces for postgresql to listen on. It’s done with the line “listen_interfaces =”So, to get postgresql to listen on a docker interface, you have to add the IP address to the configuration: This will make postgresql listen after connections from my docker container. Unfortunately when i rebooted the machine,…

Continue Reading

Playing with LXD containers

Lately I have been playing around with LXD containers, and its actually pretty cool. Lets create a new container: lxc-create -t download -n TestCont This will download the default Ubuntu image from the official repository and create a container named TestCont. Fire it up with “lxc-start -n TestCont”, connect to it with “lxc-attach -n TestCont”….

Continue Reading