Docker之基础系统Alpine Linux
Alpine是一个linux迷你系统,体积小、安全,docker中ubuntu的替代系统
gliderlabs/docker-alpine
文档Alpine
基本使用
去Alpine仓库搜索你要安装的组件(package)然后执行apk add --no-cache <Package name>
docker 中alpine使用
1 2 3 4 5 6 7 8 9 10 11
| docker run alpine echo '123' docker run -it --name myalpine alpine
apk info apk update cat /etc/apk/repositories
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories cat /etc/apk/arch apk upgrade
|
利用docker 构建mysql镜像
1 2 3
| FROM alpine:3.5 RUN apk add --no-cache mysql-client ENTRYPOINT ["mysql"]
|
构建opencv镜像
1 2 3
| FROM alpine:3.5 RUN apk add --no-cache opencv ENTRYPOINT ["opencv"]
|
参考
Alpine Linux 使用简介
1 2 3 4 5 6 7 8 9 10
| cat > /etc/apk/repositories <<EOF https://mirrors.aliyun.com/alpine/v3.7/main/ https://mirrors.aliyun.com/alpine/v3.7/community/ https://mirrors.aliyun.com/alpine/edge/testing/ EOF
https://mirrors.ustc.edu.cn/alpine/v3.6/main/ https://mirrors.ustc.edu.cn/alpine/v3.6/community/ https://mirrors.ustc.edu.cn/alpine/edge/testing/
|