<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Docker on Jason Stangroome</title>
		<link>/tags/docker/</link>
		<description>Recent content in Docker on Jason Stangroome</description>
		<generator>Hugo</generator>
		<language>en</language>
		
		
		
		
			<lastBuildDate>Tue, 05 Dec 2017 08:19:54 +0000</lastBuildDate>
		
			<atom:link href="/tags/docker/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Inspecting Docker container processes from the host</title>
				<link>/2017/12/05/inspecting-docker-container-processes-from-the-host/</link>
				<pubDate>Tue, 05 Dec 2017 08:19:54 +0000</pubDate>
				<guid>/2017/12/05/inspecting-docker-container-processes-from-the-host/</guid>
				<description>&lt;p&gt;While I favour a containerize-all-the-things approach to new projects I still need to maintain systems that were designed several years ago around a combination of containers and host-based applications working together. In these situations it is common enough to execute &lt;code&gt;ps&lt;/code&gt; or &lt;code&gt;iotop&lt;/code&gt; on the host and see all the host and container processes together with no obvious indication of which processes belong to which containers. Here I will share some simple commands to help map the host-view of a containerised process to its container. First, given a host PID, how do I know which container it belongs to?&lt;/p&gt;</description>
			</item>
			<item>
				<title>Beware Docker and sysctl defaults on GCE</title>
				<link>/2017/08/16/beware-docker-and-sysctl-defaults-on-gce/</link>
				<pubDate>Wed, 16 Aug 2017 11:00:40 +0000</pubDate>
				<guid>/2017/08/16/beware-docker-and-sysctl-defaults-on-gce/</guid>
				<description>&lt;p&gt;On Google Compute Engine (GCE) the latest VM boot images (at the time of writing) for Ubuntu 14.04 and 16.04 (eg &lt;code&gt;ubuntu-1604-xenial-v20170811&lt;/code&gt;) ship with a file at &lt;a href=&#34;https://gist.github.com/jstangroome/be4bee805c97063c28869ff4d636ed26&#34;&gt;/etc/sysctl.d/99-gce.conf&lt;/a&gt; which contains:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;    net.ipv4.ip_forward = 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This kernel parameter determines whether &lt;a href=&#34;https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt&#34;&gt;packets can be forwarded between network interfaces&lt;/a&gt;. On its own, the presence of this line isn&amp;rsquo;t a big deal. Separately, when you start the Docker daemon (at least in version 17.06.0-ce), it &lt;a href=&#34;https://docs.docker.com/engine/userguide/networking/default_network/container-communication/#communicating-to-the-outside-world&#34;&gt;sets this kernel parameter to 1&lt;/a&gt; (assuming you haven&amp;rsquo;t specified &lt;code&gt;--ip-forward=false&lt;/code&gt; in the Docker configuration). Docker needs packet forwarding enabled so that Docker containers using the default bridge network can communicate outside the host. If you later execute &lt;code&gt;sysctl --system&lt;/code&gt; or similar after has Docker has started, for example to apply a new value for the &lt;a href=&#34;https://www.kernel.org/doc/Documentation/networking/nf_conntrack-sysctl.txt&#34;&gt;nf_conntrack_max kernel parameter&lt;/a&gt; that you&amp;rsquo;ve specified in another file under &lt;code&gt;/etc/sysctl.d/&lt;/code&gt;, then the &lt;code&gt;ip_forward&lt;/code&gt; parameter will revert to 0 care of GCE&amp;rsquo;s default conf file. At this point you&amp;rsquo;ll find your containers cannot reach the outside world, for example this will fail to resolve:&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
