Alpine Linux

Alpine Linux

https://qiita.com/tukiyo3/items/247f853c81bf00e82c11

Docker 使って、いろいろとMBPに環境を作ろうとしてるんだが、それで調べてると、とにかくAlpine Linuxが軽量という話がよく出てくる。いろいろ開発環境試して見るには良いかもしれない。

ってことで、素のAlpine Linuxのイメージ落としてきて、それをそのままコンテナで起動してみた。

まあ、とにかくイメージのpullの速いこと。

$ docker pull alpine
$ docker run -itd --name alpine_test alpine /bin/sh
$ docker exec -it alpine_test /bin/sh
# ls
bin    etc    lib    mnt    proc   run    srv    tmp    var
dev    home   media  opt    root   sbin   sys    usr
# apk info
musl
busybox
alpine-baselayout
alpine-keys
libcrypto1.1
libssl1.1
ca-certificates-cacert
libtls-standalone
ssl_client
zlib
apk-tools
scanelf
musl-utils
libc-utils
# ls -l /bin
total 780
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 arch -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 ash -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 base64 -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 bbconfig -> /bin/busybox
-rwxr-xr-x    1 root     root        796240 Jan 24 07:45 busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 cat -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 chgrp -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 chmod -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 chown -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 conspy -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 cp -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 date -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 dd -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 df -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 dmesg -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 dnsdomainname -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 dumpkmap -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 echo -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 ed -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 egrep -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 false -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 fatattr -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 fdflush -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 fgrep -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 fsync -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 getopt -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 grep -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 gunzip -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 gzip -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 hostname -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 ionice -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 iostat -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 ipcalc -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 kbd_mode -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 kill -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 link -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 linux32 -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 linux64 -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 ln -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 login -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 ls -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 lzop -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 makemime -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 mkdir -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 mknod -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 mktemp -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 more -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 mount -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 mountpoint -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 mpstat -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 mv -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 netstat -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 nice -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 pidof -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 ping -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 ping6 -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 pipe_progress -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 printenv -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 ps -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 pwd -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 reformime -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 rev -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 rm -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 rmdir -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 run-parts -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 sed -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 setpriv -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 setserial -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 sh -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 sleep -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 stat -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 stty -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 su -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 sync -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 tar -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 touch -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 true -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 umount -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 uname -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 usleep -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 watch -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Mar  4 15:43 zcat -> /bin/busybox

コンテナの中に入って、入ってるパッケージやら、/bin の中を見てみた。

入ってるパッケージも結構少ない気がするし、特徴的なのが/binの中。基本的にbusyboxというバイナリに集約されていて、コマンド類は基本的に、busyboxへのシンボリックリンクとなっている。

busyboxというのも知らなかったんだが、組み込み系なんかをターゲットにした、軽量のLinuxディストリビューションで、それにパッケージ管理のapkを加えたのがAlpine Linuxらしい。

とりあえず、これをベースに色々パッケージ入れたりして試してみよう。

タグ: #
コメントはまだありません

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA