Welcome to part three of Building a Docker Media Server. If you’re a little late to the party, then be sure to check out the Introduction to the series where I share the plan to build a media server using Docker containers. In part two, published yesterday, I outlined some thoughts on hardware selection and shared the various devices I’ll be using with Docker in this series.
At this point, I need to make some assumptions about your own setup at home. As I mentioned in part two, I’ll be walking through media server configuration steps on a range of operating systems – MacOS, Windows 10, Windows 2016 Server Essentials, Linux as well as QNAP QTS and Synology DSM. What I’m not going to do in this series is walk you through the installation of those operating systems. I’ll assume you have your hardware build and your host operating system installed.
There will be some tweak that we’ll need to make to those platforms going forward – principally concerning network configuration, but I’ll leave those jobs for the next part of the series. Today we’ll get Docker installed and prepared for our media server containers.
Let me recap briefly on the plan. We’ll be installing a range of popular media server apps on our host hardware in virtual containers. Containers allow us to run apps developed for other operating systems (for example, Linux) on a wide range of alternative operating systems (Windows, MacOS and so on).
Containers are much more lightweight than virtual machines. Rather than require you to host an entire guest operating system (and the apps on top), containers include only the files, environment variables and libraries required to run the application. However, they share other resources required from the host operating system – binaries, libraries as well as physical resources. That means a containerized app runs much more efficiently than if it was installed in a virtual machine, running on a host operating system.
With containers, not only do you benefit from extended platform compatibility, but it’s also simple to back up an application’s configuration and settings, move a fully configured application between PCs, pass it on to a friend or family member for deployment elsewhere. In Enterprise, it’s quicker, easier and cheaper to deploy servers and server applications in containers – the same benefits are there for the prosumer too.
Introducing Docker Engine
Obviously, this isn’t witchcraft. There has to be some sort of translation between your host operating system and those virtualized applications to ensure everything works. If you’ve ever installed a virtual machine, you’ll probably be aware of the term “hypervisor“. It’s the special sauce that manages the execution of the guest operating system. Virtualbox, Hyper-V, VMware, Parallels? All hypervisors that virtualize hardware.
Docker is also a hypervisor. But rather than virtualizing hardware like the popular apps mentioned above, Docker virtualizes an operating system. It allows containerized apps to share the low-level core of an operating system (known as the kernel – the bit between your hardware and the bulk of your operating system) while keeping those apps in isolated processes. That means each app has its own, isolated CPU, RAM, disk and network resources and you can allocate those resources as you see fit. Indeed any processes inside the container cannot see any processes or resources outside the container – it’s as if they were the only app running on that PC.
The core of the Docker platform is “a lightweight container runtime with built in orchestration” (so says the developer) called Docker Engine. Think of it as the special sauce that ensures those media server apps play nicely on whatever operating system you prefer.
For those of you that like to get technical, here’s a schematic explaining its role in greater detail.
Installing Docker Engine
Before we can run any application containers on our host operating system, we’ll need to install Docker Engine. Fortunately, it’s really easy.
Before we do so, a quick note. As I’ll be discussing Docker on multiple operating systems in this series it’ll get tiring (for us both) very quickly if I simply repeat the same steps, delivering the same experience and the same results on different operating systems. So where possible, I’ll group operating systems together and work through a single example. Where there are minor differences between the experience on particular operating systems, I’ll call that out as we go. Where there are major differences, I’ll work through a second (or third, or fourth example). Hopefully, this approach will keep the walkthroughs succinct and prevent us all bashing our heads against our desks in boredom!
Docker Engine is the latest edition of the developer’s hypervisor software, replacing the now legacy Docker Toolbox. The latter can still do a job on older versions of host OS platforms, if Docker Engine isn’t compatible. I touched on OS compatibility in the last part of the guide, but let’s talk through requirements in a little more detail. These requirements are current as of February 2017, but are likely to change in the future. Be sure to check out the Docker website for the latest requirements.
|Apple macOS / OS X||Docker for Mac will launch only if all of these requirements are met.
|Linux||Docker Engine runs natively on Linux distributions.|
Installing Docker on MacOS & Windows
Installing Docker Engine on Windows and MacOS is really straightforward. Head over to the Docker Website where you’ll be able to download Docker Engine for free.
Once the file has downloaded, open it and follow the installation instructions presented.
In MacOS, once installed you’ll need to provide privileged access to Docker, which will allow it to install necessary networking components and links to Docker apps.
Enter your password when prompted and Docker will complete its installation before running.
On Windows 10, once Docker Engine has been installed, it will look to see if you have Microsoft’s Hyper-V feature enabled. If not, you’ll be prompted to run it. Yes, it’s going to require a reboot!
Docker runs automatically when you boot your computer. In Windows, you’ll see a Whale icon in the Windows Notification Center, while on MacOS, the icon is positioned at the top of the screen in the Menu Bar.
Verifying Your Docker Installation
To check everything is working as it should, you can drop in some commands in your favourite shell app. In Windows, that could be Powershell or a Command Prompt. On the Mac, it’s Terminal.
(returns the currently running version of Docker)
(returns the currently running version of the Docker Compose feature)
(returns the currently running version of the Docker Machine)
docker run hello-world
(downloads and runs a test container which will print a message in your shell).
So, that’s the Windows and Mac OS client operations covered. Let’s now move on to Windows Server 2016 Essentials as Docker installation is a little different here.