{"id":387,"date":"2015-03-07T14:52:31","date_gmt":"2015-03-07T19:52:31","guid":{"rendered":"http:\/\/devopsny.com\/blog\/?p=387"},"modified":"2015-07-26T18:03:16","modified_gmt":"2015-07-26T22:03:16","slug":"creating-an-htpc-stack-with-docker-things","status":"publish","type":"post","link":"https:\/\/devopsny.com\/blog\/2015\/03\/07\/creating-an-htpc-stack-with-docker-things\/","title":{"rendered":"Creating an HTPC Stack With Docker Things"},"content":{"rendered":"<h1>Introduction<\/h1>\n<p>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:<\/p>\n<ul>\n<li>Sickbeard<\/li>\n<li>Sabnzbd+<\/li>\n<li>HTPC Manager<\/li>\n<li>Plex<\/li>\n<li>Transmission web interface<\/li>\n<li>Couch Potato<\/li>\n<\/ul>\n<p>I will be using the latest Ubuntu 14.04 server distribution. This is being developed on Mac OSX Yosemite 10.10.2.<\/p>\n<p>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!<\/p>\n<p>Expect many changes as I figure this out!<\/p>\n<h1>Setup<\/h1>\n<p>You will need the following tools to start:<\/p>\n<ul>\n<li>Docker &#8211;\u00a0<a title=\"Install Docker on Mac OS X\" href=\"https:\/\/docs.docker.com\/installation\/mac\/\" target=\"_blank\">Install Docker on Mac OS X<\/a><\/li>\n<li>docker-machine &#8211; <a title=\"Docker Machine\" href=\"https:\/\/docs.docker.com\/machine\/\" target=\"_blank\">Docker Machine<\/a><\/li>\n<li>Packer &#8211; <a title=\"Packer.io\" href=\"https:\/\/packer.io\/\" target=\"_blank\">Packer.io<\/a><\/li>\n<li>Virtual Box &#8211; <a title=\"Virtual Box\" href=\"https:\/\/www.virtualbox.org\/\" target=\"_blank\">Virtual Box<\/a><\/li>\n<\/ul>\n<p>This article assumes you have installed, and are familiar with the above tools.<\/p>\n<p>I have created a root directory named htpc where all project files will reside.<\/p>\n<h1>The Docker Host<\/h1>\n<p>First create a new Docker host with the docker-machine command:<\/p>\n<pre>docker-machine create --driver virtualbox htpc<\/pre>\n<p>Now, point your docker client at the new Docker host:<\/p>\n<pre class=\"p1\"><span class=\"s1\">$(docker-machine env htpc)<\/span><\/pre>\n<h1>Sickbeard container<\/h1>\n<p>Docker hub contains thousands of community made images. Searching the hub for a Sickbeard image returns many results. I chose <a title=\"maxexcloo\/sickbeard\" href=\"https:\/\/registry.hub.docker.com\/u\/maxexcloo\/sickbeard\/\" target=\"_blank\">maxexcloo\/sickbeard<\/a> for this example. It is Debian based. First, we need to pull the image.<\/p>\n<pre>docker pull maxexcloo\/sickbeard<\/pre>\n<p>Now run it:<\/p>\n<pre class=\"p1\"><span class=\"s1\">docker $(docker-machine config htpc) run -d -p 8081:8081 --name=\"sickbeard\" maxexcloo\/sickbeard<\/span><\/pre>\n<p>This command will expose port 8081 and run the image in daemon mode (detached).<\/p>\n<p>the <em>&#8211;name&#8221;&#8221;<\/em> argument provides a nice name that will show up in the NAME column from the output of <em>docker ps.<\/em> If this argument is not suppled, a random name will be generated.<\/p>\n<p>We are almost finished. To find the IP of the Docker host:<\/p>\n<pre>docker-machine ip<\/pre>\n<p>Finally, you can point your browser at http:\/\/&lt;docker host ip&gt;:8081.<\/p>\n<h1>Sabnzbd+<\/h1>\n<p>As with Sickbeard, this container will be run similarly.<\/p>\n<p>docker pull maxexcloo\/sabnzbd<\/p>\n<p class=\"p1\"><span class=\"s1\">docker $(docker-machine config htpc) run -d -p 8080:8080 &#8211;name=&#8221;sabnzbd&#8221; maxexcloo\/sabnzbd<\/span><\/p>\n<p>Running docker ps will show something like this:<\/p>\n<pre class=\"p1\"><span class=\"s1\">CONTAINER ID<span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 \u00a0 <\/span>IMAGE<span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/span>COMMAND<span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/span>CREATED <span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/span>STATUS<span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/span>PORTS<span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/span>NAMES<\/span><\/pre>\n<pre class=\"p1\"><span class=\"s1\">b432e5cbf6df<span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 \u00a0 <\/span>maxexcloo\/sabnzbd:latest <span class=\"Apple-converted-space\">\u00a0 \u00a0 <\/span>\"\/bin\/sh -c \/config\/ <span class=\"Apple-converted-space\">\u00a0 <\/span>5 seconds ago <span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 <\/span>Up 4 seconds<span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 \u00a0 <\/span>0.0.0.0:8080-&gt;8080\/tcp <span class=\"Apple-converted-space\">\u00a0 <\/span>pensive_ritchie<span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0<\/span><\/span><\/pre>\n<pre class=\"p1\"><span class=\"s1\">dbcd9f132908<span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 \u00a0 <\/span>maxexcloo\/sickbeard:latest <span class=\"Apple-converted-space\">\u00a0 <\/span>\"\/bin\/sh -c \/config\/ <span class=\"Apple-converted-space\">\u00a0 <\/span>5 minutes ago <span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 <\/span>Up 5 minutes<span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 \u00a0 <\/span>0.0.0.0:8081-&gt;8081\/tcp <span class=\"Apple-converted-space\">\u00a0 <\/span>suspicious_tesla<\/span><\/pre>\n<p>We now have a Docker host running two images!<\/p>\n<h1>Further Thoughts<\/h1>\n<p>If this all works out as intended, possibly use vagrant-managed-servers to build out a server that already has an OS on it.<\/p>\n<p>Make my own images.<\/p>\n<h1>References<\/h1>\n<p>http:\/\/kappataumu.com\/articles\/creating-an-Ubuntu-VM-with-packer.html<\/p>\n<p>https:\/\/www.packer.io\/docs\/builders\/virtualbox-iso.html<\/p>\n<p>https:\/\/registry.hub.docker.com\/u\/maxexcloo\/sickbeard\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[64,210],"tags":[206,200,202,203,208,201,207,205,204,209],"class_list":["post-387","post","type-post","status-publish","format-standard","hentry","category-devops","category-docker","tag-couchpotato","tag-docker","tag-docker-machine","tag-htpc","tag-htpc-manager","tag-packer","tag-plex","tag-sabnzbd","tag-sickbeard","tag-transmission-web-client"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3fcrv-6f","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/posts\/387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/comments?post=387"}],"version-history":[{"count":18,"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/posts\/387\/revisions"}],"predecessor-version":[{"id":414,"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/posts\/387\/revisions\/414"}],"wp:attachment":[{"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/media?parent=387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/categories?post=387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devopsny.com\/blog\/wp-json\/wp\/v2\/tags?post=387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}