<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ruluk</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ruluk"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Ruluk"/>
	<updated>2026-04-29T08:49:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Docker&amp;diff=15871</id>
		<title>Docker</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Docker&amp;diff=15871"/>
		<updated>2019-04-05T13:19:41Z</updated>

		<summary type="html">&lt;p&gt;Ruluk: /* Installation */ Docker-compose requires new dependencies in latest version. See https://github.com/docker/compose/issues/6617#issuecomment-477974325.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Alpine makes a great docker container, because it is so small and optimized to be run in RAM.&lt;br /&gt;
It might also might make a good controller for several docker containers with enough RAM.  I haven&#039;t tested this yet&lt;br /&gt;
Docker&#039;s setup is easy to use from command line.  Commands can be run from an interactive shell, or through a configuration file called a &amp;quot;Dockerfile&amp;quot;. &lt;br /&gt;
docker.com has excellent walk-throughs on how to run, pull, setup a container, commit an image, and create a configuration file.  hub.docker.com is a freemium setup, where the first private repository is free.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
 &lt;br /&gt;
Run &amp;lt;code&amp;gt;apk add docker&amp;lt;/code&amp;gt; to install Docker on Alpine Linux.&lt;br /&gt;
&lt;br /&gt;
The Docker package is in the &#039;Community&#039; repository, so if the &#039;&#039;&#039;apk add&#039;&#039;&#039; fails with &#039;&#039;&#039;unsatisfiable constraints&#039;&#039;&#039;, you need to edit the &#039;&#039;&#039;/etc/apk/repositories&#039;&#039;&#039; file to add (or uncomment) a line like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;http://dl-cdn.alpinelinux.org/alpine/latest-stable/community&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then run &amp;lt;code&amp;gt;apk update&amp;lt;/code&amp;gt; to index the repository.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To start the Docker daemon at boot, run:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rc-update add docker boot&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Then to start the Docker daemon manually, run:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;service docker start&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|On older version of Alpine Linux with older version of docker you&#039;ll also need to disable some kernel security flags in order to build images:}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sysctl -w kernel.grsecurity.chroot_deny_chmod=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sysctl -w kernel.grsecurity.chroot_deny_mknod=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information, have a look at the [https://github.com/docker/docker/issues/20303 corresponding Github issue].&lt;br /&gt;
&lt;br /&gt;
Anyway, this weakening of security is not necessary to do with Alpine 3.4.x and Docker 1.12 as of August 2016 anymore.&lt;br /&gt;
&lt;br /&gt;
=== Docker Compose ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To install docker-compose, first install pip:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apk add py-pip&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Since docker-compose version 1.24.0, you also need some dev dependencies:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;apk add python-dev libffi-dev openssl-dev gcc libc-dev make&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Then install docker-compose, run:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pip install docker-compose&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Isolate containers with a user namespace ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
adduser -SDHs /sbin/nologin dockremap&lt;br /&gt;
addgroup -S dockremap&lt;br /&gt;
echo dockremap:$(cat /etc/passwd|grep dockremap|cut -d: -f3):65536 &amp;gt;&amp;gt; /etc/subuid&lt;br /&gt;
echo dockremap:$(cat /etc/passwd|grep dockremap|cut -d: -f4):65536 &amp;gt;&amp;gt; /etc/subgid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and add in &#039;&#039;&#039;/etc/docker/daemon.json&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{  &lt;br /&gt;
        &amp;quot;userns-remap&amp;quot;: &amp;quot;dockremap&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;You may also consider these options : &#039;&#039;&#039;&lt;br /&gt;
        &amp;quot;experimental&amp;quot;: false,&lt;br /&gt;
        &amp;quot;live-restore&amp;quot;: true,&lt;br /&gt;
        &amp;quot;ipv6&amp;quot;: false,&lt;br /&gt;
        &amp;quot;icc&amp;quot;: false,&lt;br /&gt;
        &amp;quot;no-new-privileges&amp;quot;: false&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You will find all possible configurations here[https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file].&lt;br /&gt;
&lt;br /&gt;
== Example: How to install docker from Arch ==&lt;br /&gt;
&lt;br /&gt;
https://wiki.archlinux.org/index.php/Docker&lt;br /&gt;
&lt;br /&gt;
== &amp;quot;WARNING: No {swap,memory} limit support&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
You may, probably, encounter this message by executing &amp;lt;code&amp;gt;docker info&amp;lt;/code&amp;gt;.&lt;br /&gt;
To correct this situation we have to enable the &amp;lt;code&amp;gt;cgroup_enable=memory swapaccount=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Alpine 3.8 ====&lt;br /&gt;
Well I&#039;m not sure it was&#039;nt the case before but for sure with Alpine 3.8 you must config cgroups properly&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &amp;quot;cgroup /sys/fs/cgroup cgroup defaults 0 0&amp;quot; &amp;gt;&amp;gt; /etc/fstab&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;gt;&amp;gt; /etc/cgconfig.conf &amp;lt;&amp;lt;EOF&lt;br /&gt;
mount {&lt;br /&gt;
cpuacct = /cgroup/cpuacct;&lt;br /&gt;
memory = /cgroup/memory;&lt;br /&gt;
devices = /cgroup/devices;&lt;br /&gt;
freezer = /cgroup/freezer;&lt;br /&gt;
net_cls = /cgroup/net_cls;&lt;br /&gt;
blkio = /cgroup/blkio;&lt;br /&gt;
cpuset = /cgroup/cpuset;&lt;br /&gt;
cpu = /cgroup/cpu;&lt;br /&gt;
}&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Grub ===&lt;br /&gt;
Well; if you use Grub it is like any other linux and you just have to add the cgroup condition into &amp;lt;code&amp;gt;/etc/default/grub&amp;lt;/code&amp;gt; than upgrade your grub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;GRUB_CMDLINE_LINUX_DEFAULT=&amp;quot;... e=memory swapaccount=1&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Extlinux ===&lt;br /&gt;
With Extlinux you also add the cgroup condition but inside &amp;lt;code&amp;gt;/etc/update-extlinux.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;default_kernel_opts=&amp;quot;... cgroup_enable=memory swapaccount=1&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
than update the config and reboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;How to use docker&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
The best documentation for how to use Docker and create containers is at the main docker site.  Adding anything more to it here would be redundant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;http://docs.docker.com/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
if you create an account at docker.com you can browse through other user&#039;s images and learn from the syntax in contributor&#039;s dockerfiles.&lt;br /&gt;
&lt;br /&gt;
Official Docker image files are denoted by a blue ribon on the website.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [https://www.erianna.com/creating-a-alpine-linux-repository/ Creating &amp;amp; Hosting an Alpine Linux Package Repository for Docker Packages]&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Ruluk</name></author>
	</entry>
</feed>