我正在使用 Alpine、php7.2-fpm 和 Composer 构建 Docker 镜像。
尝试安装 Composer 时会出现问题,它使用 https 通过 php 下载安装程序。
我添加了存储库以便能够安装 php7.2(用于安装 Composer)及其软件包:
RUN wget -O /etc/apk/keys/phpearth.rsa.pub https://repos.php.earth/alpine/phpearth.rsa.pub && \
echo "https://repos.php.earth/alpine/v3.7" >> /etc/apk/repositories && \
apk update
Run Code Online (Sandbox Code Playgroud)
当我尝试下载composer时出现以下错误:
/ # php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
PHP Warning: copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1
PHP Stack trace:
PHP 1. {main}() Command line code:0
PHP 2. copy() Command line …Run Code Online (Sandbox Code Playgroud)