先保证/etc/apk/repositories中包含下面的源:
https://mirrors.aliyun.com/alpine/latest-stable/community/
https://mirrors.aliyun.com/alpine/latest-stable/main
http://dl-cdn.alpinelinux.org/alpine/latest-stable/main/
http://dl-cdn.alpinelinux.org/alpine/latest-stable/community/
如果要指定版本的源,则指定版本号
https://mirrors.aliyun.com/alpine/v3.8/community/
https://mirrors.aliyun.com/alpine/v3.8/main
http://dl-cdn.alpinelinux.org/alpine/v3.8/main/
http://dl-cdn.alpinelinux.org/alpine/v3.8/community/
docker安装运行下面指令:
apk add docker
service docker start
rc-update add docker boot
安装docker-compose:
apk add py-pip
pip install docker-compose
docker服务启动配置文件在/etc/conf.d/docker,修改DOCKER_OPTS开启docker api端口:
# /etc/conf.d/docker: config file for /etc/init.d/docker
# where the docker daemon output gets piped
# this contains both stdout and stderr. If you need to separate them,
# see the settings below
#DOCKER_LOGFILE="/var/log/docker.log"
# where the docker daemon stdout gets piped
# if this is not set, DOCKER_LOGFILE is used
#DOCKER_OUTFILE="/var/log/docker-out.log"
# where the docker daemon stderr gets piped
# if this is not set, DOCKER_LOGFILE is used
#DOCKER_ERRFILE="/var/log/docker-err.log"
# where docker's pid get stored
#DOCKER_PIDFILE="/run/docker.pid"
# where the docker daemon itself is run from
#DOCKERD_BINARY="/usr/bin/dockerd"
# any other random options you want to pass to docker
DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"
# disable grsecurity features
#disable_grsec="chroot_deny_chmod chroot_deny_mknod"
安装docker-machine:
curl -L https://github.com/docker/machine/releases/download/v0.12.0/docker-machine-`uname -s`-`uname -m` > /tmp/docker-machine
chmod +x /tmp/docker-machine
mv /tmp/docker-machine /usr/local/bin/docker-machine
参见: