<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>LaForge's home page (Posts about docker)</title><link>https://laforge.gnumonks.org/</link><description></description><atom:link href="https://laforge.gnumonks.org/blog/tags/docker.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><lastBuildDate>Thu, 24 Oct 2024 20:08:49 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Overhyped Docker</title><link>https://laforge.gnumonks.org/blog/20170503-docker-overhyped/</link><dc:creator>Harald Welte</dc:creator><description>&lt;section id="overhyped-docker-missing-the-most-basic-features"&gt;
&lt;h2&gt;Overhyped Docker missing the most basic features&lt;/h2&gt;
&lt;p&gt;I've always been extremely skeptical of suddenly emerging over-hyped
technologies, particularly if they advertise to solve problems by adding
yet another layer to systems that are already sufficiently complex
themselves.&lt;/p&gt;
&lt;p&gt;There are of course many issues with containers, ranging from replicated
system libraries and the basic underlying statement that you're giving
up on the system packet manager to properly deal with dependencies.&lt;/p&gt;
&lt;p&gt;I'm also highly skeptical of FOSS projects that are primarily driven by
one (VC funded?) company.  Especially if their offering includes a
so-called &lt;em&gt;cloud service&lt;/em&gt; which they can stop to operate at any given
point in time, or (more realistically) first get everybody to use and
then start charging for.&lt;/p&gt;
&lt;p&gt;But well, despite all the bad things I read about it over the years, on
one day in May 2017 I finally thought let's give it a try.  My problem
to solve as a test balloon is fairly simple.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="my-basic-use-case"&gt;
&lt;h2&gt;My basic use case&lt;/h2&gt;
&lt;p&gt;The plan is to start OsmoSTP, the m3ua-testtool and the sua-testtool,
which both connect to OsmoSTP.  By running this setup inside containers
and inside an internal network, we could then execute the entire
testsuite e.g.  during jenkins test without having IP address or port
number conflicts.  It could even run multiple times in parallel on one
buildhost, verifying different patches as part of the continuous
integration setup.&lt;/p&gt;
&lt;p&gt;This application is not so complex.  All it needs is three containers,
an internal network and some connections in between.  Should be a piece
of cake, right?&lt;/p&gt;
&lt;p&gt;But enter the world of buzzword-fueled web-4000.0 software-defined
virtualised and orchestrated container NFW + SDN vodoo: It turns out to
be impossible, at least not with the preferred tools they advertise.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="dockerfiles"&gt;
&lt;h2&gt;Dockerfiles&lt;/h2&gt;
&lt;p&gt;The part that worked relatively easily was writing a few Dockerfiles to
build the actual containers.  All based on debian:jessie from the
library.&lt;/p&gt;
&lt;p&gt;As m3ua-testsuite is written in guile, and needs to build some guile
plugin/extension, I had to actually include guile-2.0-dev and other
packages in the container, making it a bit bloated.&lt;/p&gt;
&lt;p&gt;I couldn't immediately find a nice example Dockerfile recipe that would
allow me to build stuff from source outside of the container, and then
install the resulting binaries into the container.  This seems to be a
somewhat weak spot, where more support/infrastructure would be helpful.
I guess the idea is that you simply install applications via package
feeds and apt-get.  But I digress.&lt;/p&gt;
&lt;p&gt;So after some tinkering, I ended up with three docker containers:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;one running OsmoSTP&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;one running m3ua-testtool&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;one running sua-testtool&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I also managed to create an internal &lt;em&gt;bridged&lt;/em&gt; network between the
containers, so the containers could talk to one another.&lt;/p&gt;
&lt;p&gt;However, I have to manually start each of the containers with ugly long
command line arguments, such as &lt;code class="docutils literal"&gt;docker run &lt;span class="pre"&gt;--network&lt;/span&gt; sigtran &lt;span class="pre"&gt;--ip&lt;/span&gt;
172.18.0.200 &lt;span class="pre"&gt;-it&lt;/span&gt; &lt;span class="pre"&gt;osmo-stp-master&lt;/span&gt;&lt;/code&gt;.  This is of course sub-optimal, and
what Docker Services + Stacks should resolve.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="services-stacks"&gt;
&lt;h2&gt;Services + Stacks&lt;/h2&gt;
&lt;p&gt;The idea seems good: A &lt;em&gt;service&lt;/em&gt; defines how a given container is run,
and a &lt;em&gt;stack&lt;/em&gt; defines multiple containers and their relation to each
other.  So it should be simple to define a &lt;em&gt;stack&lt;/em&gt; with three
&lt;em&gt;services&lt;/em&gt;, right?&lt;/p&gt;
&lt;p&gt;Well, it turns out that it is not. Docker documents that you can
configure a static &lt;code class="docutils literal"&gt;ipv4_address&lt;/code&gt; &lt;a class="brackets" href="https://laforge.gnumonks.org/blog/20170503-docker-overhyped/#footnote-1" id="footnote-reference-1" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;1&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt; for each service/container, but it
seems related configuration statements are simply silently
ignored/discarded &lt;a class="brackets" href="https://laforge.gnumonks.org/blog/20170503-docker-overhyped/#footnote-2" id="footnote-reference-2" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;2&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;, &lt;a class="brackets" href="https://laforge.gnumonks.org/blog/20170503-docker-overhyped/#footnote-3" id="footnote-reference-3" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;3&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;, &lt;a class="brackets" href="https://laforge.gnumonks.org/blog/20170503-docker-overhyped/#footnote-4" id="footnote-reference-4" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;4&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This seems to be related that for some strange reason &lt;em&gt;stacks&lt;/em&gt; can (at
least in later versions of docker) only use &lt;em&gt;overlay&lt;/em&gt; type networks,
rather than the much simpler &lt;em&gt;bridge&lt;/em&gt; networks.  And while bridge
networks appear to support static IP address allocations, overlay
apparently doesn't.&lt;/p&gt;
&lt;p&gt;I still have a hard time grasping that something that considers itself a
serious product for production use (by a company with estimated value
over a billion USD, not by a few hobbyists) that has no support for
running containers on static IP addresses.  that.  How many applications
out there have I seen that require static IP address configuration?  How
much simpler do setups get, if you don't have to rely on things like
dynamic DNS updates (or DNS availability at all)?&lt;/p&gt;
&lt;p&gt;So I'm stuck with having to manually configure the network between my
containers, and manually starting them by clumsy shell scripts, rather
than having a proper abstraction for all of that.  Well done :/&lt;/p&gt;
&lt;/section&gt;
&lt;section id="exposing-ports"&gt;
&lt;h2&gt;Exposing Ports&lt;/h2&gt;
&lt;p&gt;Unrelated to all of the above:  If you run some software inside
containers, you will pretty soon want to expose some network services
from containers.  This should also be the most basic task on the planet.&lt;/p&gt;
&lt;p&gt;However, it seems that the creators of docker live in the early 1980ies,
where only TCP and UDP transport protocols existed.  They seem to have
missed that by the late 1990ies to early 2000s, protocols like &lt;a class="reference external" href="https://datatracker.ietf.org/doc/rfc2960"&gt;SCTP&lt;/a&gt; or &lt;a class="reference external" href="https://datatracker.ietf.org/doc/rfc4340/"&gt;DCCP&lt;/a&gt; were invented.&lt;/p&gt;
&lt;p&gt;But yet, in 2017, Docker chooses to&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;blindly assume TCP in
&lt;a class="reference external" href="https://docs.docker.com/engine/reference/builder/#expose"&gt;https://docs.docker.com/engine/reference/builder/#expose&lt;/a&gt; without even
mentioning it (or designing the syntax to accept any specification of
the protocol)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;design a syntax (&lt;code class="docutils literal"&gt;/tcp&lt;/code&gt;) in the command-line parsing (see
&lt;a class="reference external" href="https://docs.docker.com/engine/reference/run/#expose-incoming-ports"&gt;https://docs.docker.com/engine/reference/run/#expose-incoming-ports&lt;/a&gt;), but then
only parse tcp and udp, despite people requesting support for other
protocols like SCTP &lt;a class="reference external" href="https://github.com/moby/moby/issues/9689"&gt;as early as three years ago&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now some of the readers may think 'who uses SCTP anyway'.  I will give
you a straight answer: Everyone who has a mobile phone uses SCTP.  This
is due to the fact that pretty much all the connections inside cellular
networks (at least for 3G/4G networks, and in reality also for many 2G
networks) are using SCTP as underlying transport protocol, from the
radio access network into the core network.  So every time you switch
your phone on, or do anything with it, you are using SCTP.  Not on your
phone itself, but by all the systems that form the network that you're
using.  And with the drive to C-RAN, NFV, SDN and all the other
buzzwords also appearing in the Cellular Telecom field, people should
actually worry about it, if they want to be a part of the software stack
that is used in future cellular telecom systems.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="summary"&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;After spending the better part of a day to do something that seemed like
the most basic use case for running three networked containers using
Docker, I'm back to step one: Most likely inventing some custom
scripts based on &lt;a class="reference external" href="http://man7.org/linux/man-pages/man2/unshare.2.html"&gt;unshare&lt;/a&gt; to run my three
test programs in a separate network namespace for isolated execution of
test suite execution as part of a Jenkins CI setup :/&lt;/p&gt;
&lt;p&gt;It's also clear that Docker apparently don't care much about playing a
role in the Cellular Telecom world, which is increasingly moving away
from proprietary and hardware-based systems (like STPs) to virtualised,
software-based systems.&lt;/p&gt;
&lt;aside class="footnote-list brackets"&gt;
&lt;aside class="footnote brackets" id="footnote-1" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="https://laforge.gnumonks.org/blog/20170503-docker-overhyped/#footnote-reference-1"&gt;1&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&lt;a class="reference external" href="https://docs.docker.com/compose/compose-file/#ipv4address-ipv6address"&gt;https://docs.docker.com/compose/compose-file/#ipv4address-ipv6address&lt;/a&gt;&lt;/p&gt;
&lt;/aside&gt;
&lt;aside class="footnote brackets" id="footnote-2" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="https://laforge.gnumonks.org/blog/20170503-docker-overhyped/#footnote-reference-2"&gt;2&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&lt;a class="reference external" href="https://forums.docker.com/t/docker-swarm-1-13-static-ips-for-containers/28060"&gt;https://forums.docker.com/t/docker-swarm-1-13-static-ips-for-containers/28060&lt;/a&gt;&lt;/p&gt;
&lt;/aside&gt;
&lt;aside class="footnote brackets" id="footnote-3" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="https://laforge.gnumonks.org/blog/20170503-docker-overhyped/#footnote-reference-3"&gt;3&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&lt;a class="reference external" href="https://github.com/moby/moby/issues/31860"&gt;https://github.com/moby/moby/issues/31860&lt;/a&gt;&lt;/p&gt;
&lt;/aside&gt;
&lt;aside class="footnote brackets" id="footnote-4" role="doc-footnote"&gt;
&lt;span class="label"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;&lt;a role="doc-backlink" href="https://laforge.gnumonks.org/blog/20170503-docker-overhyped/#footnote-reference-4"&gt;4&lt;/a&gt;&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&lt;a class="reference external" href="https://github.com/moby/moby/issues/24170"&gt;https://github.com/moby/moby/issues/24170&lt;/a&gt;&lt;/p&gt;
&lt;/aside&gt;
&lt;/aside&gt;
&lt;/section&gt;</description><category>container</category><category>docker</category><category>osmocom</category><category>sigtran</category><category>telecom</category><guid>https://laforge.gnumonks.org/blog/20170503-docker-overhyped/</guid><pubDate>Tue, 02 May 2017 16:00:00 GMT</pubDate></item></channel></rss>