1. Concept
Alpine Linux is a lightweight Linux distribution for security applications. It uses musl libc and busybox to reduce system size and runtime resource consumption. It also provides its own package management tool apk.
The kernel of Alpine Linux has been patched with grsecurity/PaX, and all programs have been compiled into Position Independent Executables (PIE) to enhance system security.
2. Advantages and problems
1) Advantages
Alpine Linux's Docker image is characterized by light weight (only 5M in size) and a complete package management tool (APK); the
official Docker image may replace Ubuntu with Alpine Linux.
2) Problem
Alpine Linux uses musl, which may be different from the glibc implementation used by other Linux distributions.
Three, Alpine Linux package management
Alpine uses apk for package management. Use the apk -help command to view the complete package management commands. Common commands are listed below
apk update #更新最新本地镜像源
apk upgrade #升级软件
apk add --upgrade busybox #指定升级部分软件包
apk search #查找所以可用软件包
apk search -v #查找所有可用软件包及其描述内容
apk search -v 'acf*' #通过软件包名称查找软件包
apk search -v -d 'docker' #通过描述文件查找特定的软件包
apk info #列出所有已安装的软件包
apk info -a zlib #显示完整的软件包信息
apk info --who-owns /sbin/lbu #显示指定文件属于的包
apk add --allow-untrusted /path/to/file.apk #本地安装
Four, mirror source configuration
1) Official mirror source
http://rsync.alpinelinux.org/alpine/MIRRORS.txt镜像源配置;
MIRRORS.txt中是当前Alpine官方提供的镜像源(Alpine安装的时候系统自动选择最佳镜像源)
2) Domestic mirror source
清华TUNA镜像源:https://mirror.tuna.tsinghua.edu.cn/alpine/
中科大镜像源:http://mirrors.ustc.edu.cn/alpine/
阿里云镜像源:http://mirrors.aliyun.com/alpine/
3) Configure the software source
Take the University of Science and Technology as an example: just /etc/apk/repositories
add the corresponding source address in the file, one address per line.
vi /etc/apk/repositories
http://mirrors.ustc.edu.cn/alpine/v3.5/main
http://mirrors.ustc.edu.cn/alpine/v3.5/community