<?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=Xlice</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=Xlice"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Xlice"/>
	<updated>2026-04-28T18:21:02Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Docker&amp;diff=18066</id>
		<title>Docker</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Docker&amp;diff=18066"/>
		<updated>2020-09-12T10:59:23Z</updated>

		<summary type="html">&lt;p&gt;Xlice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation ==&lt;br /&gt;
&lt;br /&gt;
The Docker package is in the &#039;Community&#039; repository. See [[Alpine_Linux_package_management]] how to add a repository.&lt;br /&gt;
&lt;br /&gt;
 apk add docker&lt;br /&gt;
&lt;br /&gt;
Connecting to the Docker daemon through its socket requires you to add yourself to the `docker` group.&lt;br /&gt;
&lt;br /&gt;
 addgroup username docker&lt;br /&gt;
&lt;br /&gt;
To start the Docker daemon at boot, see [[Alpine_Linux_Init_System]].&lt;br /&gt;
&lt;br /&gt;
 rc-update add docker boot&lt;br /&gt;
 service docker start&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;docker-compose&#039; is in &#039;Community&#039; repository since Alpine Linux &amp;gt;= 3.10.&lt;br /&gt;
&lt;br /&gt;
 apk add docker-compose&lt;br /&gt;
&lt;br /&gt;
For older releases, do:&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;
 apk add py-pip python3-dev libffi-dev openssl-dev gcc libc-dev make&lt;br /&gt;
 pip3 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 wasn&#039;t the case before but for sure with Alpine 3.8 you must config cgroups properly&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;: This seems &#039;&#039;not&#039;&#039; to work with Alpine 3.9 and Docker 18.06. Follow the instructions for grub or extlinux below instead.&lt;br /&gt;
&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;, then 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;
=== 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;
* [[Running Alpine in a Docker Container]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Virtualization]]&lt;/div&gt;</summary>
		<author><name>Xlice</name></author>
	</entry>
</feed>