Minimal Linux distribution used mainly to create small Docker images.
Uses busybox
all-in-one binary with minimal core shell and coreutils functionality.
Replaced libc
with musl
core library which sometimes causes problems with progam compiling or grep buggy behaviour.
https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management
/etc/apk/repositories
Get the latest package lists:
apk update
Search packages for anything with the word "$name" in it:
apk search "$name"
Show all packages:
apk search
Show all packages and versions:
apk search -v
Install a given package:
apk add "$pkg"
On Alpine 3+ you can skip the prerequisite apk update
by adding the -u
switch to add:
apk add -u "$pkg"
Uninstall package:
apk del "$pkg"
Delete the local package list cache:
(usually done at the end of a Dockerfile RUN
to not save it to the docker image)
apk cache clean
List packages:
apk info
Show versions:
apk -v info
Show versions + descriptions:
apk -vv info
Find which package installed a given file on disk:
apk info --who-owns /bin/sh
Show package contents:
apk info -L <pkg>
Show all info on package:
apk info -a "$pkg"
Upgrade system, all packages:
apk upgrade
Upgrade specific package:
apk add --upgrade "$pkg"
https://github.com/genuinetools/apk-file
apt-file
but for Alpine, finds
Go binary that searches which packages contain a given filename.
docker run --rm -ti jess/apk-file <file>
Ported from private Knowledge Base page 2015+