2 回答
![?](http://img1.sycdn.imooc.com/54586870000183e302200220-100-100.jpg)
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'
![?](http://img1.sycdn.imooc.com/533e4c420001b2e502000200-100-100.jpg)
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 关注
- 587 浏览
添加回答
举报