AlpineLinux 3.7: Install docker for container

Table of Contents

1 Install docker

The following script will install docker.

  • Add user to docker group for using docker command withou sudo.

#!/bin/shset -esudo sed -e ‘s;^#http(.*)/v3.7/community;http1/v3.7/community;g’ -i /etc/apk/repositoriessudo apk updatesudo apk add dockermemb=$(grep “^docker:” /etc/group | sed -e ‘s/^.*:([^:]*)$/1/g’)[ “${memb}x” = “x” ] && memb=${USER} || memb=”${memb},${USER}”sudo sed -e “s/^docker:(.*):([^:]*)$/docker:1:${memb}/g” -i /etc/groupsudo rc-update add dockersudo reboot

2 Execution result

Run hello-world.

$ docker run hello-world<snip>Hello from Docker!<snip>

Android | Linux | SDL - Narrow Escape