Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save waleedsamy/14fc6514792795f5e71fd9fb07345819 to your computer and use it in GitHub Desktop.
Save waleedsamy/14fc6514792795f5e71fd9fb07345819 to your computer and use it in GitHub Desktop.
Run docker 1.9.1 on aws ec2 ubuntu 16.4 instance
<p><a href="https://asciinema.org/a/14"><img src="https://asciinema.org/a/14.png" alt="asciicast" title=""></a></p>
<h5 id="download-docker-binary">Download docker binary</h5>
<p><code>bash <br>
ssh [email protected] <br>
sudo su - &amp;&amp; <br>
wget https://get.docker.com/builds/Linux/x86_64/docker-1.9.1 &amp;&amp; <br>
chmod +x docker-1.9.1 <br>
mv ./docker-1.9.1 /usr/bin/docker <br>
</code></p>
<h4 id="run-docker-daemon">run docker daemon:</h4>
<p>docker 1.9.1 was a single binary, so dockerd was not avialble yet <br>
to run docker daemon you should use <code>docker daemon</code></p>
<p><code>docker daemon -H 0.0.0.0:2375</code> to make the docker daemon listen to an ip or port.</p>
<p>and to run it on background you could use <code>nohup</code> as</p>
<p><code>bash <br>
sudo nohup docker daemon -H 0.0.0.0:2375 &gt; dockerd.log 2&gt;&amp;1 &amp; <br>
</code></p>
<h4 id="run-docker-client">run docker client:</h4>
<p>you will use the same docker binary as a client as docker run <br>
<code>docker -H tcp://0.0.0.0:2375 pull alpine:3.4</code>, to not mention the <em>-H</em> flag where docker daemon is listining to, you could define</p>
<p><code>bash <br>
export DOCKER_HOST=tcp://0.0.0.0:2375 <br>
docker pull alpine:3.4 <br>
</code></p>
<p>Done.</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment