How to Setup Docker On Alpine Linux
2020-06-10Alpine Linux makes a great docker host OS — as well as a great container OS. However docker isn’t available in Alpine's default package list, and isn’t supported by Docker's automated setup script. Here is how to get it setup:
-
Add the community repo to your list of repositories.
Edit
/etc/apk/repositoriese.g. with:vi /etc/apk/repositoriesand add a line like:http://dl-cdn.alpinelinux.org/alpine/v3.12/communityInsert your alpine version. - Update your local package list:
apk update. - Install docker:
apk add docker. - Set docker to run on boot:
rc-update add docker boot. - Start the service:
service docker start. - To issue docker commands as a non-root user you will need to add your user
to the
dockergroup. The syntax for this is a little different then most distros:adduser jordan docker, here I am using my usernamejordan. - Before the group permission can take effect you need to logout and log back in.
- All done! Try it out with
docker ps.