prooph / docker-files

Collection of prooph docker files
http://getprooph.org
249 stars 89 forks source link

/app acts like a black hole #52

Closed mlavrinenko closed 3 years ago

mlavrinenko commented 3 years ago

I've faced a strange problem. Saving any data into /app produces nothing for image. Reproducing:

mkdir blackhole_app
cd blackhole_app
nano Dockerfile
FROM prooph/php:7.2-cli-xdebug

RUN echo "hello" > /app/hello.txt && ls -la /app # hello.txt exists
RUN ls -la /app # empty
docker build . --no-cache -t blackhole_app
docker run --rm blackhole_app ls -la /app # empty

ps. Using /var/www solves the problem, but why can't I use /app? pps. There is no problem with FROM composer:latest

sandrokeil commented 3 years ago

You have to create your own Dockerfile or you use another directory. Maybe you can set the Volume definition to empty before you copy your files.

Changing the volume from within the Dockerfile: If any build steps change the data within the volume after it has been declared, those changes will be discarded.

mlavrinenko commented 3 years ago

@sandrokeil Thanks for clarifying!