Alpine Linux 是一个面向安全,轻量级的基于musl libc与busybox项目的Linux发行版.
Alpine
提供了自己的包管理工具 apk
,可以通过 https://pkgs.alpinelinux.org/packages
网站上查询包信息,也可以直接通过 apk
命令直接查询和安装各种软件
alpine修改镜像源
阿里: sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories TUNA: sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories 科大: sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
apline镜像制作
https://hub.docker.com/u/veryxuliang
https://github.com/SHPyel/Docker
基础镜像测试
alpine-glibc基础镜像,基于glibc的基础镜像可以通过挂载目录
docker run -it -v /usr/local/jdk/default:/opt/jdk -e PATH=$PATH:/opt/jdk/bin --rm veryxuliang/alpine-glibc
/ # echo $PATH
/usr/local/jdk/default/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/usr/lib/groovy-2.5.8/bin:/opt/jdk/bin
/ # which java
/opt/jdk/bin/java
/ # ls /opt/jdk/