亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

alpine linux 輸出錯誤“base64: unrecognized option: w”

alpine linux 輸出錯誤“base64: unrecognized option: w”

PHP
烙印99 2022-01-08 20:06:09
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 nodeFROM php:7.1-fpm-alpineENV GITHUB_OAUTH_TOKEN testENV COMPOSER_ASSET_VERSION 1.3.1ENV DOCKERIZE_VERSION v0.6.1ENV PATH=~/.composer/vendor/bin:$PATH# install packagesRUN 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 extensionsRUN docker-php-source extract \    && cp /usr/src/php/ext/openssl/config0.m4 /usr/src/php/ext/openssl/config.m4RUN docker-php-ext-configure gd --with-png-dir=/usr/include --with-jpeg-dir=/usr/include \    && docker-php-ext-configure soap --enable-soapRUN docker-php-ext-install \    pdo \    pdo_mysql \    mysqli \    mbstring \    mcrypt \    xml \    intl \    opcache \    gd \    soap \    zip \    && docker-php-ext-enable xdebug \                             memcached# install composerRUN curl -sS https://getcomposer.org/installer | php \    && mv composer.phar /usr/local/bin/composer# install composer pluginRUN 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
查看完整描述

2 回答

?
慕妹3242003

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'


查看完整回答
反對 回復 2022-01-08
?
子衿沉夜

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


查看完整回答
反對 回復 2022-01-08
  • 2 回答
  • 0 關注
  • 705 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號