Creating an HTPC Stack With Docker Things, Part 2

This is a continuation of my previous post: Create an HTPC Stack With Docker Things. I will introduce docker-compose to bring up an environment with both containers used previously, sabnzbd and sickbeard.

I installed docker-compose using the instructions found here: Install Compose. I am using Mac OS X.

First make sure boot2docker is running, boot2docker up. Then create the following file named docker-compose.yml.

sickbeard:
  image: maxexcloo/sickbeard 
  ports:
   - "8081:8081"
  name:
   - "sickbeard"
sabnzbd:
  image: maxexcloo/sabnzbd
  ports:
   - "8080:8080"
  name:
   - "sabnzbd"

This is setting up the environment with two images, exposing the ports the application will run on and naming the image to something meaningful. each directive in the yml file map to the same docker run command.

Once this file has been created, simply run docker-compose up, and the images will be started.

To-Do

  • create a github repo for application configs.
  • map a local directory for configs.
  • add the local config directory to the yml.
  • more things…

Creating an HTPC Stack With Docker Things

Introduction

This will be a mess until I figure it all out. In this article, I will demonstrate using tools such as packer, docker client, docker-machine to build out a Docker host with an HTPC stack. The following applications will be used:

  • Sickbeard
  • Sabnzbd+
  • HTPC Manager
  • Plex
  • Transmission web interface
  • Couch Potato

I will be using the latest Ubuntu 14.04 server distribution. This is being developed on Mac OSX Yosemite 10.10.2.

This is a WIP and will be complete when it is complete. Some of these tools I have not used yet and am learning as I go!

Expect many changes as I figure this out!

Setup

You will need the following tools to start:

This article assumes you have installed, and are familiar with the above tools.

I have created a root directory named htpc where all project files will reside.

The Docker Host

First create a new Docker host with the docker-machine command:

docker-machine create --driver virtualbox htpc

Now, point your docker client at the new Docker host:

$(docker-machine env htpc)

Sickbeard container

Docker hub contains thousands of community made images. Searching the hub for a Sickbeard image returns many results. I chose maxexcloo/sickbeard for this example. It is Debian based. First, we need to pull the image.

docker pull maxexcloo/sickbeard

Now run it:

docker $(docker-machine config htpc) run -d -p 8081:8081 --name="sickbeard" maxexcloo/sickbeard

This command will expose port 8081 and run the image in daemon mode (detached).

the –name”” argument provides a nice name that will show up in the NAME column from the output of docker ps. If this argument is not suppled, a random name will be generated.

We are almost finished. To find the IP of the Docker host:

docker-machine ip

Finally, you can point your browser at http://<docker host ip>:8081.

Sabnzbd+

As with Sickbeard, this container will be run similarly.

docker pull maxexcloo/sabnzbd

docker $(docker-machine config htpc) run -d -p 8080:8080 –name=”sabnzbd” maxexcloo/sabnzbd

Running docker ps will show something like this:

CONTAINER ID        IMAGE                        COMMAND                CREATED             STATUS              PORTS                    NAMES
b432e5cbf6df        maxexcloo/sabnzbd:latest     "/bin/sh -c /config/   5 seconds ago       Up 4 seconds        0.0.0.0:8080->8080/tcp   pensive_ritchie     
dbcd9f132908        maxexcloo/sickbeard:latest   "/bin/sh -c /config/   5 minutes ago       Up 5 minutes        0.0.0.0:8081->8081/tcp   suspicious_tesla

We now have a Docker host running two images!

Further Thoughts

If this all works out as intended, possibly use vagrant-managed-servers to build out a server that already has an OS on it.

Make my own images.

References

http://kappataumu.com/articles/creating-an-Ubuntu-VM-with-packer.html

https://www.packer.io/docs/builders/virtualbox-iso.html

https://registry.hub.docker.com/u/maxexcloo/sickbeard/