Alpine Docker,你正在尋找的映象

Alpine Docker映象繼承了Alpine Linux發行版的優勢,相比於其他Linux Docker映象,它的體積非常小,僅有5。5M。

為什麼我們不選擇更小的Busybox而選擇Alpine呢

There are images such as progrium/busybox which get us very close to a minimal container and package system。 But these particular BusyBox builds piggyback on the OpenWRT package index which is often lacking and not tailored towards generic everyday applications。 Alpine Linux has a much more complete and up to date package index。

翻譯:有一些映象,例如progrium/busybox,它提供了非常接近於最小容器和包系統,但這類Busybox構建依賴於OpenWRT的包索引,而此索引通常是缺失的並且不適用於一般的日常應用。相比而言,Alpine Linux提供了一個更加完整和最新的包索引。

This makes Alpine Linux a great image base for utilities and even production applications。 Read more about Alpine Linux here and you can see how their mantra fits in right at home with Docker images。

翻譯:這一點確保了Alpine Linux作為實用程式甚至生產應用程式的一個很好的映象基礎。閱讀更多的關於Alpine Linux的內容,你將發現它們的理念是多麼的適合製作Docker映象。

例項展示

】Alpine 提供了強大包管理工具apk,更易於構建映象和容器。更多內容

$ docker run progrium/busybox opkg-install nodejsUnknown package ‘nodejs’。Collected errors:* opkg_install_cmd: Cannot install package nodejs。

$ docker run gliderlabs/alpine apk add ——no-cache nodejsfetch http://alpine。gliderlabs。com/alpine/v3。3/main/x86_64/APKINDEX。tar。gzfetch http://alpine。gliderlabs。com/alpine/v3。3/community/x86_64/APKINDEX。tar。gz(1/4) Installing libgcc (5。3。0-r0)(2/4) Installing libstdc++ (5。3。0-r0)(3/4) Installing libuv (1。7。5-r0)(4/4) Installing nodejs (4。2。3-r0)Executing busybox-1。24。1-r7。triggerOK: 29 MiB in 15 packages

附加:apk命令詳解

Alpine Docker,你正在尋找的映象

apk命令