在高山linux上执行codecept -c src run acceptance
命令时,输出以下错误:
无 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
# install dockerize
#RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
# && tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
#&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
# add node.js npm
COPY --from=node /usr/local /usr/local
RUN mkdir -p /project/test
WORKDIR /project/test
CMD ["php-fpm"]
#RUN rm /usr/local/bin/yarn /usr/local/bin/yarnpkg
答案 0 :(得分:2)
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'
答案 1 :(得分:1)
如果您要安装完整的C ++工具链,以及Python,以及几个C库的开发文件,所有这些文件均位于PHP基本映像之上,那么您将获得相当大的映像。 (如果您使用@tgogos的答案,并安装了核心Linux系统工具的副本,甚至更大的副本。)
与要安装的大量内容相比,从Alpine vs. Debian基本映像获得的空间节省非常小。如果将其更改为Debian基础,则将拥有这些工具的GNU版本提供的所有扩展。 (您还必须将List<House> houseList = /*a given list of houses*/
int c = 4;
House myHouse = null;
for (House house : houseList) {
List<Room> rooms = house.getRooms();
Room roomOfRightColor = house.getRooms.stream().filter(r -> r.getColor() == color).findFirst().orElse(null);
if (room != null) {
myHouse = house;
break;
}
if (myHouse == null) {
/*Handle null*/
}
return myHouse;
更改为apk add
并找到相应的Ubuntu软件包名称,但是在大多数情况下,它们非常相似。)我建议更改:
apt-get install