Logo

dev-resources.site

for different kinds of informations.

Host Docker Registry on a Synology NAS

Published at
3/7/2022
Categories
docker
nas
linux
Author
brendonotto
Categories
3 categories in total
docker
open
nas
open
linux
open
Author
11 person written this
brendonotto
open
Host Docker Registry on a Synology NAS

Photo by Alex Cheung on Unsplash

Post originally appeared on brendonotto.com

I've been working on a project off and on that I wanted to host and run on my Synology NAS (I have a DS920+). The best way to host custom software on it is to run Docker images but I didn't want to push this to a public repo, I have a local server after all 😁.

Get Docker Repo image

This step is pretty simple, run the Docker Repository image on your NAS. It can be found searching the registry:

Synology Docker Registry search

Once the registry container is started we need to do two things, one on your machine creating your Docker images and one on the server (or NAS in my case)

Local changes

Open up your Docker Desktop client and navigate to Settings -> Docker Engine. On this screen we'll add a property to the JSON object for insecure-registries. It's an array of strings, below is an example:



"insecure-registries": [
    "192.168.1.123:9500"
]


Enter fullscreen mode Exit fullscreen mode

I'm running my registry on port 9500 so I'll need to specify it in the URL. Use the port you mapped when starting the container. Now that's done you should be able to push to that registry with:



docker image push 192.168.1.123:9500/{imageName}:{version}


Enter fullscreen mode Exit fullscreen mode

At this point you should have a running registry with an image in it!

Server / NAS Changes

This part gets a bit inception-y. We have to tell the NAS that there's an insecure registry we'd like to use to retrieve images from that it's hosting itself. This means SSH'ing into the Synology and updating a configuration file. Once SSH'd in we'll need to update /var/packages/Docker/etc/dockerd.json as sudo so that we can write the changes back to the file system. Once in this file is open (I use vi for quick changes like this) we can add an entry for the same property that we added client side: insecure-registries with the same array parameter with one value. What I found weird and is most likely a fluke is that I had to add the new entry into the correct alphabetically ordered location in the JSON object. It shouldn't matter but it did πŸ€·β€β™‚οΈ.

Once the update is done to the file, save and close it. We'll need to restart the Docker service in order for it to recognize the change in configuration. You can do this two ways:



sudo systemctl restart pkgctl-Docker


Enter fullscreen mode Exit fullscreen mode

or



synopkgctl restart pkgctl-Docker


Enter fullscreen mode Exit fullscreen mode

The first one is standard systemd on Linux, the second one being Synology's command line tool for managing their packages.

Once this is done use a tool like Portainer or open the settings for the Docker view in your Synology dashboard and add your new repo!

Synology use local Docker Registry

Thanks for reading! ✌

nas Article's
30 articles in total
Favicon
Proxmox NAS Storage: Securing a Samba DAS
Favicon
Proxmox Network Storage: Firewall Rules
Favicon
Proxmox and NAS: Implementing VLANs for Network Isolation
Favicon
Proxmox: Network Storage
Favicon
Unraid: Das ultimative Tool fΓΌr deine Heimserver πŸš€
Favicon
Understanding Transcoding on NAS: A Comprehensive Guide
Favicon
How to install the most recent Python in your Synology diskstation
Favicon
My failsafe development environment
Favicon
Access your Synology NAS with a custom domain on Bunny.net (DDNS)
Favicon
Synology - Container Manager - Run a Docker Compose Project on CRON schedule
Favicon
How to Mounting NAS in 3 Way
Favicon
Cloud Backup Solutions for Synology NAS Users: A Comprehensive Guide
Favicon
The Future of SBC is Here: Exploring Raspberry Pi 5's Cutting-Edge Features
Favicon
Network Attached Storage (NAS)
Favicon
Raspberry 4 with SSD and nvme adapters performance
Favicon
WHAT'S BETTER FOR FILE SECURITY: NAS OR CLOUD BACKUP?
Favicon
Safeguarding Your Data: Understanding the Significance of a NAS Backup Solution
Favicon
5 NAS Backup Strategies: Pros and Cons Explained
Favicon
Kubespider: A unified download orchestration system, build your home download center.
Favicon
5 Reasons Why Your Organization Needs A NAS Backup Solution
Favicon
DIY low power NAS 2022: 1 - The hardware
Favicon
Time-machine backup with your home server.
Favicon
My open source NAS build (based on ZFS)
Favicon
What is your favorite NAS distro/software?
Favicon
Is Owning A Dedicated NAS A Worthwhile Investment?
Favicon
Host Docker Registry on a Synology NAS
Favicon
How to recover the firmware of a NAS
Favicon
Setup NAS on Raspberry Pi 4 - Part 2
Favicon
Setup NAS on Raspberry Pi 4 - Part 1
Favicon
Setup NAS on Raspberry Pi 4 - Part 3

Featured ones: