Alpine: Docker commands
// update repositories
vi /etc/apk/repositories
// add mirrors below
#/media/cdrom/apks
http://mirrors.tuna.tsinghua.edu.cn/alpine/v3.8/main
http://mirrors.tuna.tsinghua.edu.cn/alpine/v3.8/community
# add by dijk
http://mirrors.aliyun.com/alpine/v3.8/main/
http://mirrors.aliyun.com/alpine/v3.8/community/
http://mirrors.ustc.edu.cn/alpine/v3.8/main
http://mirrors.ustc.edu.cn/alpine/v3.8/community
#http://dl-cdn.alpinelinux.org/alpine/v3.8/main
#http://dl-cdn.alpinelinux.org/alpine/v3.8/community
apk update
// install docker
apk add docker
// delete docker
apk del docker
// stop/start/restart docker
$ service docker stop | start | restart
// set auto start
$ rc-update add docker boot #增加一个服务
$ rc-update del docker boot #删除一个服务
// test docker
# docker run hello-world
// see images
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest 4ab4c602aa5e 3 months ago 1.84kB
// get alpine 3.8 image
# docker pull alpine:3.8
3.8: Pulling from library/alpine
4fe2ade4980c: Pull complete
Digest: sha256:621c2f39f8133acb8e64023a94dbdf0d5ca81896102b9e57c0dc184cadaf5528
Status: Downloaded newer image for alpine:3.8
// see images again
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
alpine 3.8 196d12cf6ab1 2 months ago 4.41MB
hello-world latest 4ab4c602aa5e 3 months ago 1.84kB
// create data volume container
# docker run -it --name=workspace -v /workspace:/workspace:Z alpine:3.8
// install git
# apk add git