Есть docker-compose.yml:
Код: Выделить всё
...
php-fpm:
build:docker/containers/php-fpm
volumes:
- ./.:/var/www
- ./volumes/php-fpm/php7.1-fpm.ini:/usr/local/etc/php/php.ini
...
./docker/containers/php-fpm/Dockerfile:
Код: Выделить всё
FROM php:7.1-fpm-alpine
RUN apk --update --virtual build-deps add \
autoconf \
make \
gcc \
g++ \
libtool \
icu-dev \
curl-dev \
freetype-dev \
imagemagick-dev \
pcre-dev \
postgresql-dev \
libmcrypt-dev \
libjpeg-turbo-dev \
libpng-dev \
libxml2-dev && \
apk add \
git \
curl \
bash \
bash-completion \
icu \
imagemagick \
pcre \
freetype \
libmcrypt \
libintl \
libjpeg-turbo \
libpng \
libltdl \
libxml2 \
mysql-client \
nodejs-npm \
postgresql && \
pecl install \
apcu \
imagick \
mcrypt-1.0.0 && \
docker-php-ext-configure gd \
--with-gd \
--with-freetype-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ && \
docker-php-ext-configure bcmath && \
docker-php-ext-install \
soap \
zip \
curl \
bcmath \
exif \
gd \
iconv \
intl \
mbstring \
opcache \
pdo_mysql \
pdo_pgsql && \
apk del \
build-deps
ARG phpIniPath=/usr/local/etc/php/php.ini
RUN sed -ri -e 's/^allow_url_fopen\s*=.*/allow_url_fopen = On/' $phpIniPath
RUN sed -i -e 's/^allow_url_fopen\s*=.*/allow_url_fopen = On/' $phpIniPath
RUN sed -i -e 's/^short_open_tag\s*=.*/short_open_tag = On/' $phpIniPath
RUN sed -i -e 's/^;extension=php_curl.dll\s*=.*/extension=php_curl.dll/' $phpIniPath
RUN echo 'extension = mcrypt.so' >> $phpIniPath
WORKDIR /var/www
Код: Выделить всё
sudo docker-compose up --build -d
...
Step 8/9 : RUN sed -ri -e 's/^allow_url_fopen\s*=.*/allow_url_fopen = On/' $phpIniPath
---> Running in 84504b5e4c25
sed: /usr/local/etc/php/php.ini: No such file or directory
ERROR: Service 'php-fpm' failed to build: The command '/bin/sh -c sed -ri -e 's/^allow_url_fopen\s*=.*/allow_url_fopen = On/' $phpIniPath' returned a non-zero code: 1
Подскажите на каком моменте можно получить файл /usr/local/etc/php/php.ini в контейнере?