Table of Contents
This tip is about the how to install Docker Engine on Alpine Linux. So read this free guide, How to install Docker Engine on Alpine Linux step by step. If you have query related to same article you may contact us.
How to install Docker Engine on Alpine Linux – Guide
I’m thinking about overhauling the infrastructure behind this site (and others) a bit and want to put as many services as possible into Docker containers that can run inside a small virtual machine on Amazon EC2. So I started playing around with some virtual machines locally, and as Ubuntu would be really boring, I decided to give Alpine Linux a try. It promises to be very lightweight, so it looks ideal as a container host running inside a VM.
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.