This article will describe installing docker. Please see here for usage of Docker.
Table of Contents
1 Install docker
The following script will install docker.
- Add user to docker group for using docker command withou sudo.
#!/bin/sh -e sudo sed -e 's;^#http\(.*\)/v3.8/community;http\1/v3.8/community;g' \ -i /etc/apk/repositories sudo apk update sudo apk add docker haveged sudo rc-update add docker sudo rc-update add haveged memb=$(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/group sudo reboot
2 Execution result
Run hello-world.
$ docker run hello-world <snip> Hello from Docker! <snip>