How to install Docker Engine on Alpine Linux – Guide

1. Add the community repository to the APK repository file:

~ # vim / etc / apk / repositories Add the following line: http://dl-6.alpinelinux.org/alpine/edge/community Or, if you’re using a mirror, use the mirror’s URL, in my case: http://mirror1.hs-esslingen.de/pub/Mirrors/alpine/edge/community

2. Update the list of available software:

~ # apk update

3. Install Docker:

~ # apk add docker

4. Configure the docker daemon to start automatically on boot:

~ # rc-update add docker boot

5. Start the docker daemon:

~ # service docker start

6. Check if it is working:

~ # docker ps

The output should look like this:

CONTAINER ID IMAGE COMMAND CREATED PORT NAMES OF STATUS Great, I now have a Docker Daemon running. It’s time to build a simple container. I quickly created a very short Dockerfile and ran the docker build. After downloading some layers, it crashed with a very cryptic error message: Failed to register layer: ApplyLayer 1 exit status stdout: stderr: chmod / bin / mount: permission denied Googling this message led me to a lot of rabbit holes, but no final of accounts, it only takes a single command to make it disappear: sysctl -w kernel.grsecurity.chroot_deny_chmod = 0 This disables a security feature inside the kernel, therefore, might not be safe for a production environment that runs containers, but I think it’s acceptable for the machine that just builds them.

Final note

I hope you like the guide How to install Docker Engine on Alpine Linux. In case if you have any query regards this article you may ask us. Also, please share your love by sharing this article with your friends.

How to install Docker Engine on Alpine Linux  2022  - 52How to install Docker Engine on Alpine Linux  2022  - 93How to install Docker Engine on Alpine Linux  2022  - 26How to install Docker Engine on Alpine Linux  2022  - 42