alpine linux 输出错误“base64: unrecognized option: w”

codecept -c src run acceptance在alpine linux上执行命令时输出如下错误:


无 base64:无法识别的选项:w BusyBox v1.30.1(2019-06-12 17:51:55 UTC)多调用二进制。


用法:base64 [-d] [文件]


Base64 编码或解码 FILE 到标准输出 -d 解码数据


我看不到 codecept 正在执行的命令。


我试图在 apk 中添加 base64,但 base64 不存在。


Dockerfile:


FROM node:10-alpine AS node

FROM php:7.1-fpm-alpine


ENV GITHUB_OAUTH_TOKEN test

ENV COMPOSER_ASSET_VERSION 1.3.1

ENV DOCKERIZE_VERSION v0.6.1

ENV PATH=~/.composer/vendor/bin:$PATH


# install packages

RUN apk add -U --no-cache \

        curl-dev \

        libxml2-dev \

        libpng-dev \

        libjpeg-turbo-dev \

        zip \

        libzip-dev \

        unzip \

        gmp-dev \

        python \

        make \

        autoconf \

        memcached-dev \

        libmemcached-dev \

        libmcrypt-dev \

        icu-dev \

        g++


RUN pecl install xdebug \

                 memcached


# install PHP extensions

RUN docker-php-source extract \

    && cp /usr/src/php/ext/openssl/config0.m4 /usr/src/php/ext/openssl/config.m4

RUN docker-php-ext-configure gd --with-png-dir=/usr/include --with-jpeg-dir=/usr/include \

    && docker-php-ext-configure soap --enable-soap

RUN docker-php-ext-install \

    pdo \

    pdo_mysql \

    mysqli \

    mbstring \

    mcrypt \

    xml \

    intl \

    opcache \

    gd \

    soap \

    zip \

    && docker-php-ext-enable xdebug \

                             memcached


# install composer

RUN curl -sS https://getcomposer.org/installer | php \

    && mv composer.phar /usr/local/bin/composer


# install composer plugin

RUN composer global require hirak/prestissimo \

    && composer config --global github-oauth.github.com $GITHUB_OAUTH_TOKEN \

    && composer config -g repos.packagist composer https://packagist.jp \

    && composer global require fxp/composer-asset-plugin:^$COMPOSER_ASSET_VERSION

烙印99
浏览 588回答 2
2回答

慕妹3242003

这些alpine图像似乎有一个base64不提供-w选项的版本:docker container run -it --rm alpine:3.9 base64 --helpBusyBox 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&nbsp; &nbsp; -d&nbsp; Decode data但如果你执行apk add --update coreutils它就在那里:docker container run -it --rm alpine:3.9/ # apk add --update coreutilsfetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gzfetch 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.triggerOK: 7 MiB in 17 packages/ # base64 --helpUsage: 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.&nbsp; -d, --decode&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; decode data&nbsp; -i, --ignore-garbage&nbsp; when decoding, ignore non-alphabet characters&nbsp; -w, --wrap=COLS&nbsp; &nbsp; &nbsp; &nbsp;wrap encoded lines after COLS character (default 76).&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Use 0 to disable line wrapping&nbsp; &nbsp; &nbsp; --help&nbsp; &nbsp; &nbsp;display this help and exit&nbsp; &nbsp; &nbsp; --version&nbsp; output version information and exitThe data are encoded as described for the base64 alphabet in RFC 4648.When decoding, the input may contain newlines in addition to the bytes ofthe formal base64 alphabet.&nbsp; Use --ignore-garbage to attempt to recoverfrom 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'

子衿沉夜

如果你要安装一个完整的 C++ 工具链,还有 Python,还有几个 C 库的开发文件,都在 PHP 基础镜像之上,你会得到一个相当大的镜像。(如果您使用@tgogos 的答案并安装核心 Linux 系统工具的副本,甚至更大。)与您正在安装的大量东西相比,您从 Alpine 与 Debian 基础映像中节省的空间非常少。如果您将其更改为 Debian 基础,那么您将拥有这些工具的 GNU 版本提供的所有扩展。(你也必须改变apk add,以apt-get install找到相应的Ubuntu的软件包的名称,但在大多数情况下,这些都是非常相似的。)我建议改变:FROM&nbsp;php:7.1-fpm&nbsp;#&nbsp;not&nbsp;-alpine
打开App,查看更多内容
随时随地看视频慕课网APP