2 回答

TA貢獻1824條經驗 獲得超6個贊
這些alpine圖像似乎有一個base64不提供-w選項的版本:
docker container run -it --rm alpine:3.9 base64 --help
BusyBox v1.29.3 (2019-01-24 07:45:07 UTC) multi-call binary.
Usage: base64 [-d] [FILE]
Base64 encode or decode FILE to standard output
-d Decode data
但如果你執行apk add --update coreutils它就在那里:
docker container run -it --rm alpine:3.9
/ # apk add --update coreutils
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
(1/3) Installing libattr (2.4.47-r7)
(2/3) Installing libacl (2.2.52-r5)
(3/3) Installing coreutils (8.30-r0)
Executing busybox-1.29.3-r10.trigger
OK: 7 MiB in 17 packages
/ # base64 --help
Usage: base64 [OPTION]... [FILE]
Base64 encode or decode FILE, or standard input, to standard output.
With no FILE, or when FILE is -, read standard input.
Mandatory arguments to long options are mandatory for short options too.
-d, --decode decode data
-i, --ignore-garbage when decoding, ignore non-alphabet characters
-w, --wrap=COLS wrap encoded lines after COLS character (default 76).
Use 0 to disable line wrapping
--help display this help and exit
--version output version information and exit
The data are encoded as described for the base64 alphabet in RFC 4648.
When decoding, the input may contain newlines in addition to the bytes of
the formal base64 alphabet. Use --ignore-garbage to attempt to recover
from any other non-alphabet bytes in the encoded stream.
GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Report base64 translation bugs to <https://translationproject.org/team/>
Full documentation at: <https://www.gnu.org/software/coreutils/base64>
or available locally via: info '(coreutils) base64 invocation'

TA貢獻1828條經驗 獲得超3個贊
如果你要安裝一個完整的 C++ 工具鏈,還有 Python,還有幾個 C 庫的開發文件,都在 PHP 基礎鏡像之上,你會得到一個相當大的鏡像。(如果您使用@tgogos 的答案并安裝核心 Linux 系統工具的副本,甚至更大。)
與您正在安裝的大量東西相比,您從 Alpine 與 Debian 基礎映像中節省的空間非常少。如果您將其更改為 Debian 基礎,那么您將擁有這些工具的 GNU 版本提供的所有擴展。(你也必須改變apk add
,以apt-get install
找到相應的Ubuntu的軟件包的名稱,但在大多數情況下,這些都是非常相似的。)我建議改變:
FROM php:7.1-fpm # not -alpine
- 2 回答
- 0 關注
- 705 瀏覽
添加回答
舉報