VirtualBox中安装alpine linux(二)安装docker

Alpine Linux下Docker安装与配置
本文详细介绍了在Alpine Linux系统中安装Docker、Docker Compose及Docker Machine的过程。包括添加阿里云镜像源,通过apk工具安装Docker,配置Docker服务启动,以及安装和配置Docker Compose和Docker Machine的方法。

先保证/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

参见:

https://blog.csdn.net/MaxWoods/article/details/85148156

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

螃蟹就是横着走

感谢您的支持!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值