{"id":839,"date":"2020-08-13T20:22:44","date_gmt":"2020-08-13T20:22:44","guid":{"rendered":"http:\/\/10.0.0.14\/?p=839"},"modified":"2021-06-22T20:41:11","modified_gmt":"2021-06-22T20:41:11","slug":"installing-docker-on-a-lxc-antsle-antlet","status":"publish","type":"post","link":"https:\/\/tutorials.leesonresearch.com\/tutorials\/2020\/08\/13\/installing-docker-on-a-lxc-antsle-antlet\/","title":{"rendered":"Installing Docker on a LXC Antsle Antlet with a Bridged Network"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">What is Antsle?<\/h4>\n\n\n\n<p>Antsle is essentially a private Devops environment which is a Edge Linux server sitting on my desk. I find the Antsle to be a great sandbox to learn about Devops which allows me to spin up servers ala AWS, mess with them, blow them up, trash them and start over.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Configure IP Address<\/h4>\n\n\n\n<p>Note: If you&#8217;re not logged in as root you will need to prefix all your commands with sudo. If you want to switch to root so your don&#8217;t have to bother sudo run:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\nsudo -i\n<\/pre><\/div>\n\n\n<p>Update the interfaces file to add a dhcp address:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\nvi \/etc\/network\/interfaces\n<\/pre><\/div>\n\n\n<p>&#8230; update the file to:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\nauto eth1\niface eth1 inet dhcp\n<\/pre><\/div>\n\n\n<p>If you want to configure a static ip use the following instead:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\nauto eth1\niface eth1 inet static\n address 192.168.1.105\n netmask 255.255.255.0\n gateway 192.168.1.1\n dns-nameservers 192.168.1.1\n<\/pre><\/div>\n\n\n<p>Or if you&#8217;re on a Mac:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\nauto eth1\niface eth1 inet static\n address 10.0.0.105\n netmask 255.255.255.0\n gateway 10.0.0.1\n dns-nameservers 10.0.0.1\n<\/pre><\/div>\n\n\n<p>Restart network service:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\nifup eth1\n\nInternet Systems Consortium DHCP Client 4.3.3\nCopyright 2004-2015 Internet Systems Consortium.\nAll rights reserved.\nFor info, please visit https:\/\/www.isc.org\/software\/dhcp\/\n\nListening on LPF\/eth1\/52:54:00:f3:90:b5\nSending on   LPF\/eth1\/52:54:00:f3:90:b5\nSending on   Socket\/fallback\nDHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 3 (xid=0xebfd814c)\nDHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 6 (xid=0xebfd814c)\nDHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 11 (xid=0xebfd814c)\nDHCPREQUEST of 10.0.0.18 on eth1 to 255.255.255.255 port 67 (xid=0x4c81fdeb)\nDHCPOFFER of 10.0.0.18 from 10.0.0.1\nDHCPACK of 10.0.0.18 from 10.0.0.1\nbound to 10.0.0.18 -- renewal in 255291 seconds.\n<\/pre><\/div>\n\n\n<p>The dynamic IP address given to me is 10.0.0.18, (I&#8217;m on a Mac). Let&#8217;s ping the address to confirm that it&#8217;s available on our local net. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\nping 10.0.0.18\nPING 10.0.0.18 (10.0.0.18): 56 data bytes\n64 bytes from 10.0.0.18: icmp_seq=0 ttl=64 time=1.038 ms\n64 bytes from 10.0.0.18: icmp_seq=1 ttl=64 time=0.931 ms\n64 bytes from 10.0.0.18: icmp_seq=2 ttl=64 time=0.302 ms\n64 bytes from 10.0.0.18: icmp_seq=3 ttl=64 time=0.295 ms\n64 bytes from 10.0.0.18: icmp_seq=4 ttl=64 time=0.374 ms\n^C\n--- 10.0.0.18 ping statistics ---\n5 packets transmitted, 5 packets received, 0.0% packet loss\nround-trip min\/avg\/max\/stddev = 0.295\/0.588\/1.038\/0.327 ms\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">Install Docker Engine<\/h4>\n\n\n\n<p>Update the <code>apt<\/code> package index and install packages to allow <code>apt<\/code> to use a repository over HTTPS:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\napt-get update\n\nsudo apt-get install \\\n    apt-transport-https \\\n    ca-certificates \\\n    curl \\\n    gnupg-agent \\\n    software-properties-common\n<\/pre><\/div>\n\n\n<p>Before we can use curl to add Docker&#8217;s official GPG key we need to update our new antlet, (in my case antlet10) to the host file otherwise we will get the error: unable to resolve host antletXX.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\nvi \/etc\/hosts\n\n# \/etc\/hosts\n127.0.0.1   localhost\n127.0.0.1   antlet10\n<\/pre><\/div>\n\n\n<p>Now we can add the GPG key:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\ncurl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo apt-key add -\n<\/pre><\/div>\n\n\n<p>Then we are supposed to verify that we have the key with the fingerprint <code>9DC8 5822 9FC7 DD38 854A&nbsp;&nbsp;E2D8 8D81 803C 0EBF CD88<\/code>, by searching for the last 8 characters of the fingerprint.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\napt-key fingerprint 0EBFCD88\npub   4096R\/0EBFCD88 2017-02-22\n      Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88\nuid                  Docker Release (CE deb) &amp;lt;docker@docker.com&gt;\nsub   4096R\/F273FCD8 2017-02-22\n<\/pre><\/div>\n\n\n<p>Next we setup the stable Docker repository:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\nsudo add-apt-repository \\\n   &quot;deb &#x5B;arch=amd64] https:\/\/download.docker.com\/linux\/ubuntu \\\n   $(lsb_release -cs) \\\n   stable&quot;\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">Install Docker Engine<\/h4>\n\n\n\n<p>The official Docker docs tell us to use the latest version of Docker Engine:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\napt-get update\napt-get install docker-ce docker-ce-cli containerd.io\n<\/pre><\/div>\n\n\n<p>On my Ubuntu LXC Antlet I got an error installing the most recent version of Docker Engine and while searching the web for a fix I found this handy work-around which is installing an earlier version of Docker Engine.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\napt-get update\napt install docker-ce=17.09.1~ce-0~ubuntu\n<\/pre><\/div>\n\n\n<p>Now we verify that all is well by running the hello-world image:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\ndocker run hello-world\n\nHello from Docker!\nThis message shows that your installation appears to be working correctly.\n<\/pre><\/div>\n\n\n<p>Last but not least, we install Docker Compose.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Install Docker Compose<\/h4>\n\n\n\n<p>Run the following to install the latest version of Docker Compose:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\ncurl -L &quot;https:\/\/github.com\/docker\/compose\/releases\/download\/1.26.2\/docker-compose-$(uname -s)-$(uname -m)&quot; -o \/usr\/local\/bin\/docker-compose\n<\/pre><\/div>\n\n\n<p>Set executable permissions to the binary:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\nchmod +x \/usr\/local\/bin\/docker-compose\n<\/pre><\/div>\n\n\n<p>Test our version of Docker Compose:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: Double click to copy; notranslate\" title=\"Double click to copy\">\ndocker-compose --version\n<\/pre><\/div>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting up a bridged network on Ubuntu Xenial LXC Antsle Antlet with Docker.<\/p>\n","protected":false},"author":1,"featured_media":842,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49,11],"tags":[48],"class_list":["post-839","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-antsle","category-server-ops","tag-antsle"],"_links":{"self":[{"href":"https:\/\/tutorials.leesonresearch.com\/tutorials\/wp-json\/wp\/v2\/posts\/839","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tutorials.leesonresearch.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tutorials.leesonresearch.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tutorials.leesonresearch.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tutorials.leesonresearch.com\/tutorials\/wp-json\/wp\/v2\/comments?post=839"}],"version-history":[{"count":13,"href":"https:\/\/tutorials.leesonresearch.com\/tutorials\/wp-json\/wp\/v2\/posts\/839\/revisions"}],"predecessor-version":[{"id":1993,"href":"https:\/\/tutorials.leesonresearch.com\/tutorials\/wp-json\/wp\/v2\/posts\/839\/revisions\/1993"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tutorials.leesonresearch.com\/tutorials\/wp-json\/wp\/v2\/media\/842"}],"wp:attachment":[{"href":"https:\/\/tutorials.leesonresearch.com\/tutorials\/wp-json\/wp\/v2\/media?parent=839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tutorials.leesonresearch.com\/tutorials\/wp-json\/wp\/v2\/categories?post=839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tutorials.leesonresearch.com\/tutorials\/wp-json\/wp\/v2\/tags?post=839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}