Server Build Exercises on AWS (Amazon Web Services) 2022 edition

busybox

小さな linux 環境(busybox)を起動してみましょう。 busybox は市販の linux ベースのルータなど、 組み込み機器っぽいつくりをしたい linux 製品に組み込まれています。

実行してみる

docker run --rm -it busybox

実行すると dockerhub からイメージをダウンロードし、/ #というプロンプトが出てきたと思います

docker run --rm -it busybox        
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
3aab638df1a9: Pull complete 
Digest: sha256:52817dece4cfe26f581c834d27a8e1bcc82194f914afe6d50afad5a101234ef1
Status: Downloaded newer image for busybox:latest
/ # 

あとは linux コマンドを実行すれば、なにか表示されます。 まぁサーバでも何でもないので特におもしろいことがあるわけでもありませが、 コマンドの練習ができますかね? まぁ自分のコンテナを作る母体にすることもあるでしょう

終了するにはexitを入力します

実行例

/ # ps
PID   USER     TIME  COMMAND
    1 root      0:00 sh
    8 root      0:00 ps
/ # pwd
/
/ # ls
bin   dev   etc   home  proc  root  sys   tmp   usr   var

なお ls bin を実行すれば、利用可能なコマンドがすべて表示されます。 2021/12/05 現在 402 個のコマンドが同梱されていますね

終了するにはexitを入力します

コラム

busybox は BSD Unix がインストーラで使っていた ( 共通部品の多い数十のUnix基本コマンドを一つに合体して小さくしたうえで、 カーネル内に埋め込む ) テクニック(mdsetimage で検索)を linux で再実装したものです。

オリジナルの作者は Debian プロジェクトの二代目リーダ Bruce Perens です。 なお Bruce Perens は、 オープンソースという用語の理論武装を考えた張本人でもあります。 また Debian の開発コードが映画トイ・ストーリーのキャラクタをつける習わしになっているのは、 この風習をはじめた当時 Bruce Perens がトイ・ストーリーを作っていた会社ピクサーに努めていたからだという話があります

Last updated on 5 Dec 2021
Published on 5 Dec 2021
Copyright (C) 2021-2022 Ken'ichi Fukamachi, All rights reserved. CC BY-NC-SA 4.0
We appreciate AWS Academy Japan for the offer of the learning environment.

Powered by Hugo. Theme by TechDoc. Designed by Thingsym.