Alpine Linux Docker 镜像中包含哪些内容?

Alpine Linux Docker 镜像中包含哪些内容?

官方 Alpine Linux Docker 镜像中包含哪些标准 Linux 命令行工具?

(您所期望的哪些内容缺失了?)

我尝试用谷歌搜索这个但没有成功。

答案1

这些是安装在官方 Alpine Linux Docker 镜像中的软件包,标记为latest

$ docker run alpine:latest apk list --installed
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.17/main: No such file or directory
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.17/community: No such file or directory
musl-1.2.3-r4 x86_64 {musl} (MIT) [installed]
zlib-1.2.13-r0 x86_64 {zlib} (Zlib) [installed]
apk-tools-2.12.10-r1 x86_64 {apk-tools} (GPL-2.0-only) [installed]
busybox-binsh-1.35.0-r29 x86_64 {busybox} (GPL-2.0-only) [installed]
musl-utils-1.2.3-r4 x86_64 {musl} (MIT AND BSD-2-Clause AND GPL-2.0-or-later) [installed]
alpine-baselayout-3.4.0-r0 x86_64 {alpine-baselayout} (GPL-2.0-only) [installed]
alpine-keys-2.4-r1 x86_64 {alpine-keys} (MIT) [installed]
libcrypto3-3.0.7-r0 x86_64 {openssl} (Apache-2.0) [installed]
busybox-1.35.0-r29 x86_64 {busybox} (GPL-2.0-only) [installed]
scanelf-1.3.5-r1 x86_64 {pax-utils} (GPL-2.0-only) [installed]
ca-certificates-bundle-20220614-r2 x86_64 {ca-certificates} (MPL-2.0 AND MIT) [installed]
libc-utils-0.7.2-r3 x86_64 {libc-dev} (BSD-2-Clause AND BSD-3-Clause) [installed]
ssl_client-1.35.0-r29 x86_64 {busybox} (GPL-2.0-only) [installed]
alpine-baselayout-data-3.4.0-r0 x86_64 {alpine-baselayout} (GPL-2.0-only) [installed]
libssl3-3.0.7-r0 x86_64 {openssl} (Apache-2.0) [installed]

假设您所说的“标准工具”是指“常见工具”,则 Alpine Linux 上提供的大多数命令行工具都是内置的busybox,其中包括以下实用程序:

$ docker run alpine:latest busybox --list | column
[               eject           klogd           paste           su
[[              env             last            pgrep           sum
acpid           ether-wake      less            pidof           swapoff
add-shell       expand          link            ping            swapon
addgroup        expr            linux32         ping6           switch_root
adduser         factor          linux64         pipe_progress   sync
adjtimex        fallocate       ln              pivot_root      sysctl
arch            false           loadfont        pkill           syslogd
arp             fatattr         loadkmap        pmap            tac
arping          fbset           logger          poweroff        tail
ash             fbsplash        login           printenv        tar
awk             fdflush         logread         printf          tee
base64          fdisk           losetup         ps              test
basename        fgrep           ls              pscan           time
bbconfig        find            lsattr          pstree          timeout
bc              findfs          lsmod           pwd             top
beep            flock           lsof            pwdx            touch
blkdiscard      fold            lsusb           raidautorun     tr
blkid           free            lzcat           rdate           traceroute
blockdev        fsck            lzma            rdev            traceroute6
brctl           fstrim          lzop            readahead       true
bunzip2         fsync           lzopcat         readlink        truncate
bzcat           fuser           makemime        realpath        tty
bzip2           getopt          md5sum          reboot          ttysize
cal             getty           mdev            reformime       tunctl
cat             grep            mesg            remove-shell    udhcpc
chattr          groups          microcom        renice          udhcpc6
chgrp           gunzip          mkdir           reset           umount
chmod           gzip            mkdosfs         resize          uname
chown           halt            mkfifo          rev             unexpand
chpasswd        hd              mkfs.vfat       rfkill          uniq
chroot          head            mknod           rm              unix2dos
chvt            hexdump         mkpasswd        rmdir           unlink
cksum           hostid          mkswap          rmmod           unlzma
clear           hostname        mktemp          route           unlzop
cmp             hwclock         modinfo         run-parts       unshare
comm            id              modprobe        sed             unxz
cp              ifconfig        more            sendmail        unzip
cpio            ifdown          mount           seq             uptime
crond           ifenslave       mountpoint      setconsole      usleep
crontab         ifup            mpstat          setfont         uudecode
cryptpw         init            mv              setkeycodes     uuencode
cut             inotifyd        nameif          setlogcons      vconfig
date            insmod          nanddump        setpriv         vi
dc              install         nandwrite       setserial       vlock
dd              ionice          nbd-client      setsid          volname
deallocvt       iostat          nc              sh              watch
delgroup        ip              netstat         sha1sum         watchdog
deluser         ipaddr          nice            sha256sum       wc
depmod          ipcalc          nl              sha3sum         wget
df              ipcrm           nmeter          sha512sum       which
diff            ipcs            nohup           showkey         who
dirname         iplink          nologin         shred           whoami
dmesg           ipneigh         nproc           shuf            whois
dnsdomainname   iproute         nsenter         slattach        xargs
dos2unix        iprule          nslookup        sleep           xxd
du              iptunnel        ntpd            sort            xzcat
dumpkmap        kbd_mode        od              split           yes
echo            kill            openvt          stat            zcat
ed              killall         partprobe       strings
egrep           killall5        passwd          stty

正如您所看到的,这包括您可能期望在 Unix 或 Linux 系统上找到的大多数实用程序,包括vi编辑器和文本处理工具的变体,例如sedawk。您还可以获得各种系统管理和其他各种工具。

我忽略了有关“缺少预期工具”的问题,因为这取决于系统的用途。apk如果需要,通常会使用 Dockerfile 安装缺少的应用程序。在裸机上运行 Alpine Linux 时,您可能需要安装任意数量的东西,例如图形桌面环境,或者可能只是功能更丰富的 shell 和编辑器或手册。

相关内容