Docker Synology Download



  1. Note: I will be using the command line in this guide however the containers will still be visible in the Synology Docker UI. TL;DR (too long, don’t read) Download the docker-compose.yaml 1 file to your Synology, edit all the network addresses replacing the example network 192.168.123.X with your own network. And run the following command.
  2. Applied Models.The models of this series are not compatible with the latest version of DSM. For details, please refer to the Product Support Status page. Please note that DS712+, RS2211RP+, RS2211+, DS411+II, DS411+, DS2411+, and DS1511+ are not compatible with Active Backup for Business since they do not support Btrfs.

I’ve been running Pi-Hole on my Synology for a good few years. It has taken me a while to figure out how to run it the way I liked to which is why I wrote the previous guide a few years ago. (see: Running Pi-Hole inside Docker on Synology)

Although this has helped me and many others, I was never quite happy about the outcome and have strived to find a better way. I didn’t want to have to rely on WebStation or anything else outside of the docker container. Thankfully I stumbled upon dockers network driver named macvlan.

Wait, I thought you said Synology's Docker package installs both Docker and Docker Compose. Yes, I did say that. But Synology's docker packages usually tend to be quite old. At the time of writing this, the currently available versions of Docker and Docker Compose are 19.03.12 and 1.26.2, respectively. But here is what Synology Package Center. Once that resource has been added, search the package center for Docker. Once Docker has been installed, run it and navigate to the registry tab to search for Sonarr. We prefer LinuxServer’s automatic builds. Once you find the one you would like, select it and click download it. Dec 31, 2020 This is a stark difference from Synology’s Docker GUI, as you can back up the important container data, but you can’t port it over to a different operating system easily. A few downsides of Docker Compose on a Synology NAS: Everything is done through the command-line interface (CLI).

Note: I will be using the command line in this guide however the containers will still be visible in the Synology Docker UI.

TL;DR (too long, don’t read)

Download the docker-compose.yaml1 file to your Synology, edit all the network addresses replacing the example network 192.168.123.X with your own network. and run the following command:

If it all works Pi-Hole will be running on IP .199. Continue reading to understand (hopefully!)

If your names is using IP x.x.x.199 then please change the above!

Using macvlan for networking

Macvlan is a network driver provided by Docker, the following is an extract from the documentation

Some applications, especially legacy applications or applications which monitor network traffic, expect to be directly connected to the physical network. In this type of situation, you can use the macvlan network driver to assign a MAC address to each container’s virtual network interface, making it appear to be a physical network interface directly connected to the physical network.

So the idea is that we will create our own docker network using the macvlan driver, this will then allow us to connect our Pi-Hole container onto this network which will assign it it’s own MAC. This will then appear to be directly connected on our host network but will have it’s own IP and therefore all network ports available.

A new network can be easily created using the following command (but hold off, we’ll go into actually doing this later using configuration files)

In all my examples I will be using the network 192.168.123.0/24. If you use any of the downloaded files please update these entries to your specific network.

Download

Note: The IP address range in the above command of 192.168.123.192 / 28 might appear strange. This is so that we can restrict the IP addresses docker uses so not to clash with our physical machines see IP calculator.

Making things easier using docker compose

I’m quite a lazy guy when if comes to repitition. I quickly became fed up of clicking around the docker UI to create containers, update containers and to modify them. Luckily docker comes with a way to automate this setup with the command docker-compose. I now use this to create all my containers that I run but in this example we will focus on Pi-Hole.

Note: I’m using version 2 of the docker compose format. This is the only version that seems to support specifying MAC and IP addresses which to me is very handy. It only needs to be specified once at the top of each file.

Docker compose requires a configuration file that is in YAML format. This is just plain text so can be edited using any application however, whitespace is important so no TAB characters please.

In the docker compose file we can create the network (macvlan), we can create our service (Pi-Hole) and optionally assign specific MAC and IP addresses. I will explain each section individually to build up the complete picture. I will also attach a download link at the bottom of the article so that you are not forced to copy & paste.

If you want to follow along then ssh to your Synology, create a file name docker-compose.yaml and add the following snippets. You can then try this out running the following command in the same place as the file you created. This command will re-create the config each time so you do not need to delete previous versions.

For more information try sudo docker-compose up —help

Start by specifying the version.

Defining the network:

This creates a new network named pihole_network using the parent network interface ovs_en0. This will be visible in the Synology docker UI under networks.

Please check your network interface using ipconfig and change the parent device above to match.

Next we need to add our Pi-Hole container. This can be added with the following configuration.

We specify our containers name, image and various networking information plus the environments required by Pi-Hole.

The combination of these two configurations are all that is required to create and run Pi-Hole on your Synology NAS. The complete file can be downloaded here.1

If you need more information the documentation can be found here.

How do we use docker compose

Assuming you have your docker compose file correctly setup (either writing your own or downloading one of mine) you can now start up Pi-Hole from the command line. If all works out then Pi-Hole should now be up and running and visible inside the Synology Docker UI.

Synology Docker Image Download

Docker compose requires root access which will ask for your admin password. The -d is needed to run in daemon mode, if we do not supply this then the command will block in the shell.

How do we go about updating - you might ask?

Updating to the latest image is very easy. You can run the following commands.

Optionally you can specify the service $sudo docker-compose up pihole if you have mulitple services

Xpenology

This will download the new version and then re-create the updated Pi-Hole container.

Optional step; one file per container

As I have many containers running on my Synology I separated each service into it’s own file and included it along with it’s configuration and volumes. This way I can compose many docker files together rather than having one huge file. This is accomplished by the following in my main docker-compose.yaml file in the full example:

Synology Docker Container Download

Downloading the combined2 file will give you the mulitple docker files, or you can download the single1 file for a basic simple container.

Head over to my project on gitlab to see all files in full 3

Without a doubt, after installing several images on your Synology NAS using the Docker package, you are wondering how to update your containers quickly and easily. If you have installed Pi-Hole, AdGuard, Splunk,BitWarden, Reactive Resume, YouTube Downloader,Whoogle,JDownloader 2, HOOBS, Homebridge, Home Assistant, Jellyfin, Guacamole, Droppy, Plex, Calibre, Nginx Proxy Manager, Nextcloud, Heimdall, DokuWiki, BookStack, WordPress, FreshRSS, Netdata, FileZilla, Syncthing or the UniFi Controller by following the guides in this blog, you may need updates for your containers. Read on and find out how to update your image/container.

Update 8 January 2021 Install Watchtower to automatically update your Docker images/containers without any manual action.

If you want to Manually update your Docker Containers follow the steps below

Please Support My work by Making a Donation.

Open the Docker package and download the new latest image from the Registry tab, for example Pi-Hole, AdGuard etc.

When the download is complete, go to the Container tab and stop the container you are updating.

Xpenology

Docker

Next, select the container and, using the Action drop-down menu, select Clear (Container tab). The container will be removed from the list and recreated using the image you downloaded in STEP 2.

Synology Docker Package Download

Start the new container. Once it loads, it is ready for use.

Docker Synology Download Station

Note: If your configs are stored on your Synology NAS, they will be recognized, and the container should run as designated.
Note: You can also use Ouroboros to automatically update your Docker images/containers.

Docker Synology Download Station

This post was updated on Monday / January 18th, 2021 at 12:12 AM