Scott Hanselman

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

November 30, 2016 Comment on this post [27] 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
Hosting By
Hosted in an Azure App Service
November 30, 2016 1:37
Synology is a great product. Just a note that they aren't the only ones. QNAP had Docker for quite a while.
November 30, 2016 3:01
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.
November 30, 2016 4:32
@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.
November 30, 2016 7:47
I highly recommend setting up a Docker Hub registry mirror, here's a gist with my setup: https://gist.github.com/g0t4/d5c9e446a51db3b591025fa2b75e99fc
November 30, 2016 9:05
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
November 30, 2016 10:35
Bertrand - FOSCAM FI8918W

Xiao - yes. It caches for four hours.
November 30, 2016 12:54
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.
November 30, 2016 13:33
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.
November 30, 2016 13:36
One more informations: Docker on DSM need 64bit architecture, 32bit is not enough.
November 30, 2016 13:49
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.
November 30, 2016 13:49
http://moszi.net/wordpress/blog/ ;)
November 30, 2016 15:42
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.
November 30, 2016 19:07
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
November 30, 2016 22:07
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.
November 30, 2016 23:22
@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.
December 01, 2016 1:16
@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!
December 01, 2016 1:55
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.
December 01, 2016 6:23
Scott I am curious about the seagate hard drives you use?
December 01, 2016 7:03
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.
December 01, 2016 8:01
@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).
December 01, 2016 8:49
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
December 01, 2016 8:51
Oops, typos to be blamed on the clever phone keyboard.
December 02, 2016 6:28
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,
December 03, 2016 22:29
Cannot that MVA video with Glenn you are mentioning....
December 13, 2016 10:28
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!

December 15, 2016 11:28
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.
December 23, 2016 13:14
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.