Dockerfile COPY failed: stat /var/lib/docker/tmp/d

2019-08-23 02:59发布

问题:

I got this docker-compose.yml file

version: '2'

services:
    db:
        image: mysql
        volumes:
            - ./.data/db:/var/lib/mysql
        environment:
            MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
            MYSQL_DATABASE: ${MYSQL_DATABASE}
            MYSQL_USER: ${MYSQL_USER}
            MYSQL_PASSWORD: ${MYSQL_PASSWORD}
        networks:
            - docker-network
    php:
        build:
            context: ./php7-fpm
            args:
                TIMEZONE: ${TIMEZONE}
        volumes:
            - ${BACK_APP_PATH}:/var/www
        environment:
            APP_ENV: "dev"
        networks:
            - docker-network

And in my php7-fpm Dockerfile i'm trying to copy some files from backend folder.

For example:

COPY --chown=www-data:www-data composer.json .

But when I build my containers it throws me this error:

ERROR: Service 'php' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder665456389/composer.json: no such file or directory