0

I'm trying to COPY a folder from host machine to docker container .

I have this structure :

.
├── .docker
│   ├── php
│   │   ├── php7
│   │       ├──Dockerfile
├── php_7   └── 
└── docker-compose.yml

docker-compose.yml :

  php7:
    build:
      context: .docker/php/php7

In the Dockerfile i tried :

COPY ../../php_7 /var/www/html
COPY ../../../php_7 /var/www/html
COPY ./php_7 /var/www/html



docker-compose down && docker-compose up -d --build

i'm always getting :

failed to solve: failed to compute cache key: "/php_7" not found: not found

How can i correctly copy the folder ?

Khaled Boussoffara
  • 1,567
  • 2
  • 25
  • 53
  • What's the executed command and in which directory you are running it? – Gastón Schabas Apr 25 '23 at 10:57
  • I might just move the Dockerfile to the top of the directory tree, next to where you have the `docker-compose.yml` file, and adjust the paths accordingly. The linked question also describes ways to do it leaving the Dockerfile in a subdirectory. – David Maze Apr 25 '23 at 11:05

0 Answers0