Scott Hanselman

Docker on a Synology NAS - Also running ASP.NET and .NET Core!

November 29, '16 Comments [32] Posted in Open Source
Sponsored By

Docker on Synology is amazingI love my Synology NAS (Network Attached Storage) device. It has sat quietly in my server closet for almost 5 years now. It was a fantastic investment. I've filled it with 8TB of inexpensive Seagate Drives and it does its own flavor of RAID to give me roughly 5TB (which, for my house is effectively infinite) of storage. In my house it's just \\SERVER or http://server. It's a little GNU Linux machine that is easier to manage and maintain (and generally deal with) that just chills in the closet. It's a personal cloud.

It also runs:

  • Plex - It's a media server with over 15 years of home movies and photos. It's even more magical when used with an Xbox One. It transcodes videos that then download to my Windows tablets or iPad...then I watch them offline on the plane.
  • VPN Server - I can remotely connect to my house. Even stream Netflix when I'm overseas.
  • Surveillance Station - It acts as a DVR and manages streams from a dozen cameras both inside and outside the house, scanning for motion and storing nearly a week of video.
  • Murmur/Mumble Server - Your own private VOIP chat service. Used for podcasts, gaming, private calls that aren't over Skype, etc.
  • Cloud Sync/Backup - I have files in Google Drive, Dropbox, and OneDrive...but I have them entirely backed up on my Synology with their Cloud Sync.

51FvMne3PyL._SL1280_Every year my Synology gets better with software upgrades. The biggest and most significant upgrade to Synology has been the addition of Docker and the Docker ecosystem. There is first class support for Docker on Synology. There are some Synology devices that are cheaper and use ARM processors. Make sure you get one with an Intel processor for best compatibility. Get the best one you can and you'll find new uses for it all the time! I have the 1511 (now 1515) and it's amazing.

ASP.NET Core on Docker on Synology

A month ago Glenn Condron and I did a Microsoft Virtual Academy on Containers and Cross-Platform .NET (coming soon!) and we made this little app and put it in Docker. It's "glennc/fancypants." That means I can easily run it anywhere with just:

docker run glennc/fancypants

Sometimes a DockerFile for ASP.NET Core can be as basic as this:

FROM microsoft/aspnetcore:1.0.1
ENTRYPOINT ["dotnet", "WebApplication4.dll"]
ARG source=.
WORKDIR /app
EXPOSE 80
COPY $source .

You could certainly use Docker Compose and have your Synology running Redis, MySql, ASP.NET Core, whatever.

Even better, since Synology has such a great UI, here is Glenn's app in the Synology web-based admin tool:

Docker on Synology - Node and ASP.NET Core Apps 

I can ssh into the Synology (you'll need to SSH in as root, or you'll want to set up Docker to allow another user to avoid this) and run docker commands directly, or I can use their excellent UI. It's really one of the nicest Docker UIs I've seen. I was able to get ASP.NET Core and the Node.js Ghost blog running in minutes with modest RAM requirements.

image

Once Containers exist in Docker on Synology you can "turn them on and off" like any service.

ASP.NET Core on Docker on Synology

This also means that your Synology can now run any Docker-based service like a private version of GitLab (good instructions here)! You could then (if you like) do cool domain mappings like gitlab.hanselman.com:someport and have your Synology do the work. The Synology could then run Jenkins or Travis as well which makes my home server fit nicely into my development workflow without use any compute resources on my main machine (or using any cloud resource at all!)

The next step for me will be to connect to Docker running on Synology remotely from my Windows machine, then setup "F5 Docker Debugging" in Visual Studio.

image

Anyone else using a Synology?

* My Amazon links pay for tacos. Please use them.


Sponsor: Big thanks to Octopus Deploy! Do you deploy the same application multiple times for each of your end customers? The team at Octopus have taken the pain out of multi-tenant deployments. Check out their latest 3.4 release!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb
Tuesday, 29 November 2016 21:37:06 UTC
Synology is a great product. Just a note that they aren't the only ones. QNAP had Docker for quite a while.
David
Tuesday, 29 November 2016 21:55:08 UTC
For some reason, this article does not show up in your home page. Must click Blog link to see.
Xiao Han
Tuesday, 29 November 2016 23:01:19 UTC
Are you running Plex on Synology or are you using just as a file server for Plex? If former, did you have any issues with transcoding/performance? Thanks.
Wednesday, 30 November 2016 00:32:39 UTC
@Scott: I'm curious about your security camera setup: what cameras do you use?

@Alek: it's a very nice Plex server that performs very well. The Synology is a real server, with a capable CPU.
Bertrand Le Roy
Wednesday, 30 November 2016 03:47:49 UTC
I highly recommend setting up a Docker Hub registry mirror, here's a gist with my setup: https://gist.github.com/g0t4/d5c9e446a51db3b591025fa2b75e99fc
Wednesday, 30 November 2016 05:05:03 UTC
I got my first synology to replace an iomega surestor that failed me twice (shame on iomega and then shame on me). Since falling in love with this wonderful and constantly improving nas, I have installed at least on or more at each of our locations for iSCSI vm datastores, backup repository, misc storage, security surveillance (primary using dlink cameras, but it supports just about any camera and even takes the place of trying to control our old sony snc cams with java pzt controls that browsers no longer support). My only gripe is that the surveillance viewer only works on certain browsers, requires a plugin, and that plugin has to be reinstalled after every synology surveillance update. But there are tons of killer features and they even have their own app store with lots of free plugin modules. Excellent product. Highly recommended!
PT
Wednesday, 30 November 2016 06:35:43 UTC
Bertrand - FOSCAM FI8918W

Xiao - yes. It caches for four hours.
Scott Hanselman
Wednesday, 30 November 2016 08:54:45 UTC
I absolutely love my Synology box, unfortunately I have an older ARM one, I'm definitely going to look at getting a Intel one to replace it.
Stuart Lang
Wednesday, 30 November 2016 09:33:23 UTC
I'm a big fan of NAS from Synology, mostly because I own one. It works on ARM so Docker is not available although it has official support for ARM. I was trying to test Mono package, but it is really under my expectations (and beta version of the package is failing with segmentation fault even for Hello world application). I hope Synology will support ARM more than it is today.
Szymon Bełus
Wednesday, 30 November 2016 09:36:33 UTC
One more informations: Docker on DSM need 64bit architecture, 32bit is not enough.
just
Wednesday, 30 November 2016 09:49:06 UTC
Man, now I want to get one of those. These are all things I would love to be able to do.

Any tips on what processor to look out for? Currently looking at the 416play (Celeron), 916+ (Pentium) and 1515+ (Atom). They all seem fine, but don't want to regret my purchase 2 years down the road.
Dirk
Wednesday, 30 November 2016 09:49:14 UTC
http://moszi.net/wordpress/blog/ ;)
Wednesday, 30 November 2016 11:42:45 UTC
Scott, I don't know if you're aware of this or not but the Synology OS has a built-in reverse proxy, that would let you set up gitlab.hanselman.com without the random port, if you like your URLs to be clean.

Paired with the automated LetsEncrypt functionality, it's a complete godsend. Let the Synology handle all the SSL and domain mapping gubbins, docker doesn't even need to know.
Wednesday, 30 November 2016 15:07:18 UTC
Great article Scott. I've been researching for a while and using your site as a resource. However, I'm wondering just like Dirk up above. Will Intel Celeron be fine, or should I look for Atom machines? Also, I've been looking at Qnap as well as David mentioned above. Any recommendations on that? Lastly, I've found that TerraMaster has some NAS as well. Specifically I'm looking at the F4-220. Has anyone here played with the TerraMaster's? Thanks. http://www.newegg.com/Product/Product.aspx?Item=9SIAA3N4SP2188&cm_re=terramaster-_-9SIAA3N4SP2188-_-Product
Gerardo Garcia
Wednesday, 30 November 2016 18:07:14 UTC
Did you see this on how to run Crashplan in Docker? https://miketabor.com/run-crashplan-docker-synology-nas/

I've so tired of the Crashplan updates. Thinking of trying it.
Marc-Andre
Wednesday, 30 November 2016 19:22:38 UTC
@Bertrand Le Roy: Thank you. I was thinking about moving my PLEX server from a laptop to a dedicated system (was considering an Intel NUK), but this is an alternative that I haven't though of before. From everything I've seen so far, people generally suggest that NAS devices are not capable enough to run multiple encoding streams. I'll take a closer look at this option. Thanks again.
Wednesday, 30 November 2016 21:16:49 UTC
@Alex Davis: Plex Server will also run from a Nvidia Shield with full transcoding support. I'm contemplating that to offload the server from my desktop.

@Scott: I had just replaced my home network with Ubiquiti UniFi devices (which I'm very happy with), and was going to look into how I could host incoming VPN connections on their gateway. Your post just now reminded me that I could use my Synology NAS instead. Thanks for that!
Mike C
Wednesday, 30 November 2016 21:55:34 UTC
Almost 5 years for your Syno...you will soon discover a very disappointing policy they have: no more updates for your NAS after 5 years. I have a 710+ that I really like, but can't install DSM 6 since it's not supported anymore.
Thursday, 01 December 2016 02:23:13 UTC
Scott I am curious about the seagate hard drives you use?
Pierrick
Thursday, 01 December 2016 03:03:35 UTC
Scott, I don't know if you're aware of this or not but the Synology OS has a built-in reverse proxy, that would let you set up gitlab.hanselman.com without the random port, if you like your URLs to be clean. A simple site.
Thursday, 01 December 2016 04:01:52 UTC
@Mike C: I looked at the Nvidia Shield option, but saw way too many complaints from early adopters (the original anouncement thread I followed was brutal). Also, the cheap version comes with a small hard drive and Plex needs a bit more space (for transcoding) and it does not work well with removable media. For a little more than a bigger drive version, I can get a fully functional NUC, which is what I will probably end up doing (I don't think the CPUs that come with Synology or alternatives, like QNAP, are capable of multistream transcoding, although, I may be wrong).
Thursday, 01 December 2016 04:49:40 UTC
I am up to my 3rd Synopsis and have been an advocate for it in all SMB I certainly across. Terrific in these contexts.

Back on docker on Syno, check out a dotnet core based container for home automation called mynodes.net available on GitHub.

The guys used the first aspnet base container and it really works really well on Syno with docker for all you home feel stuff. Add a few Pi or ESP8266 to the mix and the fun begins :).

Cheers
Manu
Emmanuel AUFFRAY
Thursday, 01 December 2016 04:51:16 UTC
Oops, typos to be blamed on the clever phone keyboard.
Emmanuel AUFFRAY
Friday, 02 December 2016 02:28:17 UTC
Since falling in love with this wonderful and constantly improving nas, I have installed at least on or more at each of our locations for iSCSI vm datastores,
Friday, 02 December 2016 04:47:40 UTC
sachin
Saturday, 03 December 2016 14:44:46 UTC
love synology NAS and synology router.
Saturday, 03 December 2016 18:29:33 UTC
Cannot that MVA video with Glenn you are mentioning....
rs38
Wednesday, 07 December 2016 11:55:01 UTC
Extremely valuable post. This is my first time i visit here. I discovered such a large number of fascinating stuff in your website particularly its talk. Truly its awesome article. Keep it up. eyebrow threading
Thursday, 08 December 2016 13:34:45 UTC
Synalogy if great for storing data yeah it does work amazing because of its powerful features.
Kyla Barnes
Tuesday, 13 December 2016 06:28:45 UTC
I absolutely love my Synology DS1511+. I have been enjoying it for over 5 years. I have 3GB of RAM and I use it to run Plex, Docker, iTunes Server, VPN, Telephony, etc, etc. I have 14TB on a RAID5 configuration. I use AWS Glacier as my cloud backup solution. I works great and gives me piece of mind. It is a mini workhorse at home and has proven a terrific investment over the years. The software keeps evolving and they keep supporting older devices. Very happy customer!

Thursday, 15 December 2016 07:28:12 UTC
Are you running Plex on Synology or are you using just as a file server for Plex? If former, did you have any issues with transcoding/performance? Thanks.
Friday, 23 December 2016 09:14:31 UTC
Showbox for tablet Here is the direct download link to get latest movies on Android smartphones.
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.