Не копируется xdebug.ini при запуске docker контейнера на Windows 7

Acvarif 21 января 2020 г. 13:36

Имеется простейшее тестовое приложение с одним файлом типа index.php
docker-compose.yml
version: '2'

volumes:
test-db:
driver: local

services:

mysql:
image: mysql:5.5
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: test
MYSQL_PASSWORD: test
MYSQL_DATABASE: test
ports:
- 3356:3306
volumes:
- test-db:/var/lib/mysql

php:
build:
dockerfile: docker/Dockerfile
context: .
ports:
- 8089:80
volumes:
- .:/var/www/html
- ./docker/apache2.conf:/etc/apache2/sites-available/000-default.conf
- ./docker/apache2.conf:/etc/apache2/sites-enabled/000-default.conf
- ./docker/.htaccess:/var/www/html/.htaccess
- ./docker/docker-php-ext-xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
- ./docker/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf

phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: phpmyadmin_test
restart: always
links:
- mysql:db
ports:
- "8004:80"
environment:
MYSQL_USER: test
MYSQL_PASSWORD: test
MYSQL_ROOT_PASSWORD: root
PMA_ARBITRARY: 1

Dockfile

FROM php:7.0-apache

RUN apt-get update -y && apt-get install -y libzip-dev zip memcached libpng-dev supervisor curl libxml2-dev libjpeg-dev libfreetype6-dev
RUN docker-php-ext-install gd

RUN docker-php-ext-configure zip --with-libzip
RUN docker-php-ext-install pdo_mysql bcmath zip simplexml

Install xdebug

RUN pecl install xdebug-2.6.1 && docker-php-ext-enable xdebug
COPY docker/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

RUN apt-get update -y && apt-get install -y libpng-dev

RUN docker-php-ext-install gd opcache

RUN a2enmod rewrite

ENTRYPOINT /usr/bin/supervisord

docker-php-ext-xdebug.ini
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=0
xdebug.idekey=docker
;use your local machine IP address here
xdebug.remote_host=192.168.1.34

apache2.conf

ServerName test.com
ServerAlias www.test.com test.com

DocumentRoot /var/www/html
DirectoryIndex index.php

CustomLog /var/www/html/log/test.com.bytes bytes
CustomLog /var/www/html/log/test.com.log combined
ErrorLog  /var/www/html/log/test.com.error.log

<Directory "/var/www/html">
    AllowOverride All
    Order Allow,Deny
    Allow from All
    Require all granted

    <IfModule mod_rewrite.c>
        RewriteCond %{REQUEST_URI} \..+$
        RewriteCond %{REQUEST_URI} !\.html$
        RewriteRule .* - [L]
        # the others are redirected to the front web controller
        RewriteRule ^(.*)$ index.php [QSA,L]
    </IfModule>
</Directory>

<Directory "/var/www/html">
    AllowOverride All
    Allow from All
</Directory>


Создается контейнер без проблем но при запуске на шаге 7 из 12 возникает проблема

Step 7/12 : COPY docker/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

Error: ResponseItem.ErrorDetail[code=,message=COPY failed: stat /mnt/sda1/var/lib/docker/tmp/docker-builder048592471/docker/docker-php-ext-xdebug.ini: no such file or directory]
Failed to deploy ' Dockerfile: docker/Dockerfile': COPY failed: stat /mnt/sda1/var/lib/docker/tmp/docker-builder048592471/docker/docker-php-ext-xdebug.ini: no such file or directory
Подскажите пожалуйста как с этим боротьтся.


crank 21 января 2020 г. 15:09

Что-то мне подсказывает что вам нужно вместо

docker/docker-php-ext-xdebug.ini

написать

./docker-php-ext-xdebug.ini