Swift on Synology DSM

Update: I made it! "It works" message finally appeared in my browser invoking the Vapor based Hello World app. The full build process takes time (~15 mins) but I eventually got a runnable Docker image.

3 Likes

Would love to read a proper guide on how to get everything up and running as I'm currently looking into getting a DSM as well. If it has some compute power left, it'd be fun to spin up a few custom swift based tools / scripts on it.

Unfortunately Docker is still not supported on non Intel architectures. It has to be installed manually. I found a useful script Install docker on arm64 synology · GitHub
This script was mentioned in this unofficial guide Installing Docker on a Synology ARM NAS | WikiArr

However running Docker on ARM based NAS-es have some issues,

  1. OS upgrades remove Docker. It has to be reinstalled every time.
  2. Only host networking is supported, no idea why. So if you want to run like a Vapor app a proxy front end will be required too.

After having Docker installed I generated a Vapor hello world app and make it run using docker-compose. Don't forget to change Swift version to swift/focal as swift:latest image has no aarch64 platform support yet.

Good luck!

UPDATE

It seems iptables is not configured properly causing limited container networking. There is a script to fix this Script to fix Docker iptables on Synology NAS · GitHub

1 Like