Stop and Disable systemd-resolved

When I build a Pi-Hole server I usually install it in Docker on an Ubuntu Server on an old Raspberry Pi or Intel NUC. The default install of Ubuntu has systemd-resolved installed which clashes when you bring the Pi-hole Docker container up. I can never remember the steps to disable systemd-resolved so this is my reminder :-) Stop and Disable systemd-resolved Check the Status of systemd-resolved: First, check if systemd-resolved is running:...

October 27, 2024

Pi-hole in a Docker Container on a Raspberry Pi

Logos Property of Pi-hole & Docker. While I was disappearing down a rabbit hole investigating unbound as a DNS Privacy server, I came across Pi-hole – A black hole for Internet advertisements. I’ve always used uBlock Origin for ad blocking but that is a per client thing which is a bit of a hassle. Pi-hole provides ad blocking for all clients on the network, seamlessly. I just configure DNS on each client, via DHCP, to point towards the Pi-Hole server....

April 23, 2018

Raspberry Pi Docker Container to send all LAN DNS requests to Cloudflare’s 1.1.1.1 DNS over TLS

I wanted to implement this on a Raspberry Pi that I have running Docker. However, I wasn’t able to find an image in Docker Hub for the ARM architecture that the Raspberry Pi uses so I made my own based on the x86-64 image, here. Place the Dockerfile and unbound.conf in the same directory. Docker file: FROM arm32v6/alpine:3.7 EXPOSE 53/udp RUN apk add --update --no-cache -q --progress unbound && \ rm -rf /etc/unbound/unbound....

April 21, 2018

Deploy Portainer in a Docker Container

Portainer is an Open-Source lightweight Management UI which allows you to easily manage your Docker Hosts or Swarm Clusters Port 9000 of the container is published to the host A 16 megabyte limit is set on the container, in this instance. Data is persisted in a named volume called ‘portainer_data’ docker run -d \ --name portainer \ --restart=unless-stopped \ --memory=16m \ -p 9000:9000 \ -v /var/run/docker.sock:/var/run/docker.sock \ -v portainer_data:/data \ portainer/portainer The container can also be deployed using the more explicit –mount flag which became available for standalone containers in Docker 17....

March 5, 2018

Deploy Watchtower in a Docker Container

Watchtower is an application that will monitor your running Docker containers and watch for changes to the images that those containers were originally started from. If watchtower detects that an image has changed, it will automatically restart the container using the new image. A 16 megabyte limit is set on the container, in this instance. I’ve added a hostname for this container because Watchtower sends emails with the hostname of the Watchtower Docker container in the subject line....

March 5, 2018

Install Docker and Compose on Ubuntu 16.04 LTS

#!/bin/bash apt-get update apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" apt-get update apt-get install -y \ docker-ce \ docker-compose If you plan on using the –memory flag when creating containers, you may need to enable memory and swap accounting in the Kernel. Log into the Ubuntu host as a user with sudo privileges....

March 5, 2018

Install Docker and Compose on Debian 9 Stretch

#!/bin/bash apt-get update apt-get install -y \ apt-transport-https \ ca-certificates \ curl \ gnupg2 \ software-properties-common curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/debian \ $(lsb_release -cs) \ stable" apt-get update apt-get install -y \ docker-ce \ docker-compose If you plan on using the –memory flag when creating containers, you may need to enable memory and swap accounting in the Kernel. Log into the Ubuntu host as a user with sudo privileges....

October 3, 2017

Check or Change the Timezone in Debian

To see or change what timezone your Debian system is configured for: dpkg-reconfigure tzdata More detailed information is available in the Debian Wiki More specifically, I used this in a setup of HypriotOS, a minimal Debian-based operating systems that is optimised to run Docker on ARM devices. In this instance it was an old Raspberry Pi Model B running NodeRed in a Docker Container. I needed to get the time in the Docker Container to match the time on the host....

August 9, 2017

Show Docker Stats with Container Name Instead of Container ID

docker stats $(docker ps --format={{.Names}}) More details in the Docker CLI Reference

January 14, 2017

Run a Bash Shell in a Running Docker Container

There was a time when I could never remember this… but now I’ve typed it so often! docker exec -it container_name /bin/bash More details in the Docker CLI Reference

November 24, 2016