How to Setup Docker On Alpine Linux

Published 2020-06-10

Alpine 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:

  1. Add the community repo to your list of repositories. Edit /etc/apk/repositories e.g. with: vi /etc/apk/repositories and add a line like: http://dl-cdn.alpinelinux.org/alpine/v3.12/community Inserting your alpine version.

  2. Update your local package list: apk update.

  3. Install docker: apk add docker.

  4. Set docker to run on boot: rc-update add docker boot.

  5. Start the service: service docker start.

  6. To issue docker commands as a non-root user you will need to add your user to the docker group. The syntax for this is a little different then most distros: adduser jordan docker, here I am using my username jordan.

  7. Before the group permission can take effect you need to logout and log back in.

  8. All done! Try it out with docker ps.