<?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=Arp242</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=Arp242"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Arp242"/>
	<updated>2026-05-05T16:10:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Docker&amp;diff=21736</id>
		<title>Docker</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Docker&amp;diff=21736"/>
		<updated>2022-04-21T07:55:22Z</updated>

		<summary type="html">&lt;p&gt;Arp242: /* Grub */ seems some stuff got lost here&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 versions of Alpine Linux with older versions of docker you&#039;ll also need to disable some kernel security flags in order to build images:}}&lt;br /&gt;
&lt;br /&gt;
 sysctl -w kernel.grsecurity.chroot_deny_chmod=0&lt;br /&gt;
 sysctl -w kernel.grsecurity.chroot_deny_mknod=0&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;
This weakening of security is not necessary to do with Alpine 3.4.x and Docker 1.12 as of August 2016.&lt;br /&gt;
&lt;br /&gt;
=== Docker Compose ===&lt;br /&gt;
&lt;br /&gt;
&#039;docker-compose&#039; is in the &#039;Community&#039; repository starting with Alpine Linux 3.10.&lt;br /&gt;
&lt;br /&gt;
 apk add docker-compose&lt;br /&gt;
&lt;br /&gt;
For older releases:&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;
add to &#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&#039;ll 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 might encounter this message when 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;
It may not have been the case before, but 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;
If you use Grub, 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;... cgroup_enable=memory swapaccount=1&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Extlinux ===&lt;br /&gt;
With Extlinux, you add the cgroup condition, but inside of &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;
then 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 on using Docker and creating containers is at the main docker site.  Adding anything 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 user images and learn from the syntax in contributed dockerfiles.&lt;br /&gt;
&lt;br /&gt;
Official Docker image files are denoted on the website by a blue ribbon.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [https://www.erianna.com/creating-a-alpine-linux-repository/ Creating and 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>Arp242</name></author>
	</entry>
</feed>