{"id":2629,"date":"2014-10-30T16:49:25","date_gmt":"2014-10-30T22:49:25","guid":{"rendered":"http:\/\/benincosa.com\/blog\/?p=2629"},"modified":"2014-11-19T11:23:55","modified_gmt":"2014-11-19T17:23:55","slug":"docker","status":"publish","type":"post","link":"https:\/\/benincosa.com\/?p=2629","title":{"rendered":"Docker"},"content":{"rendered":"<p>I&#8217;m finally jumping in on the Docker bandwagon and it is pretty exciting. \u00a0Here&#8217;s how I did a quick trial of it to make it work.<\/p>\n<h2>Install OS<\/h2>\n<p>I could do this in my AWS account, or I can do it with my local private cloud. \u00a0So many options these days. \u00a0I installed the latest Ubuntu 14.04 Trusty server on my local cloud. \u00a0It probably would have been just as easy to spin it up on AWS.<\/p>\n<p>I had to get my proxy set up correctly before I could get out to the Internet. \u00a0This was done by editing \/etc\/apt\/apt.conf. \u00a0I just added the one line:<\/p>\n<pre>Acquire::http::Proxy \"http:\/\/myproxy.com:80\";<\/pre>\n<h2>Configure for Docker<\/h2>\n<p>I followed the <a href=\"http:\/\/docs.docker.com\/installation\/ubuntulinux\/#ubuntu-trusty-1404-lts-64-bit\">docker documentation on this<\/a>. \u00a0Everything was pretty flawless. \u00a0I ran:<\/p>\n<pre>sudo apt-get update \r\nsudo apt-get install docker.io\r\nsudo ln -sf \/usr\/bin\/docker.io \/usr\/local\/bin\/docker\r\nsudo sed -i '$acomplete -F _docker docker' \/etc\/bash_completion.d\/docker.io \r\nsource \/etc\/bash_completion.d\/docker.io\r\nsudo apt-key adv --keyserver hkp:\/\/keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9\r\n\r\nsudo sh -c \"echo deb https:\/\/get.docker.com\/ubuntu docker main &gt; \/etc\/apt\/sources.list.d\/docker.list\"\r\n\r\nsudo apt-get update\r\nsudo apt-get install lxc-docker\r\n\r\nsudo docker run -i -t ubuntu \/bin\/bash \r\n<\/pre>\n<p>That last command had problems. The error I got said:<\/p>\n<pre>2014\/10\/30 15:08:42 Get https:\/\/index.docker.io\/v1\/repositories\/library\/ubuntu\/images: dial tcp 162.242.195.84:443: connection timed out\r\n<\/pre>\n<p>This is because I need to put a proxy on my docker configuration. A quick google, search lead me to do:<\/p>\n<pre>sudo vim \/etc\/default\/docker\r\n<\/pre>\n<p>I added my proxy host<\/p>\n<pre>export http_proxy=\"http:\/\/myproxy.com:80\"<\/pre>\n<p>Rerunning<\/p>\n<pre>sudo docker run -i -t ubuntu \/bin\/bash\r\n<\/pre>\n<p>And I see a ton of stuff get downloaded. Looks like it works!<\/p>\n<p>Now I have docker on my VM. \u00a0But what can we do with it? \u00a0Containers are used for applications. Creating a python application would probably be a good start. I searched around and found a <a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/docker-explained-how-to-containerize-python-web-applications\">good one on Digital Ocean&#8217;s site<\/a>.<\/p>\n<pre>sudo docker run -i -t -p 80:80 ubuntu \/bin\/bash\r\n<\/pre>\n<p>I like how it showed how to detach: CTRL-P and CTRL-Q. To reattach:<\/p>\n<pre>sudo docker ps<\/pre>\n<p>Get the image ID, then reattach<\/p>\n<pre>sudo docker attach<\/pre>\n<p>Docker is one of many interesting projects I&#8217;ve been looking at lately. For my own projects, I&#8217;ll be using Docker more for easing deployment. If you saw from my article yesterday, I&#8217;ve been working on public clouds as well as internal clouds. Connecting those clouds together and letting applications migrate between them is where I&#8217;ll be spending a few more hours on this week and next.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m finally jumping in on the Docker bandwagon and it is pretty exciting. \u00a0Here&#8217;s how I did a quick trial of it to make it work. Install OS I could do this in my AWS account, or I can do it with my local private cloud. \u00a0So many options these days. \u00a0I installed the latest&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[463,478],"tags":[1011,479,480],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/2629"}],"collection":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2629"}],"version-history":[{"count":1,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/2629\/revisions"}],"predecessor-version":[{"id":2630,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/2629\/revisions\/2630"}],"wp:attachment":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}