我正在尝试在构建docker容器时创建一个文件,构建过程中没有出现任何错误,看起来文件已经成功写入,但是当我通过ssh登录到容器时,发现文件并不存在。
I write the file by doing
RUN echo "Some line to add to a file" >> /var/www/public/text.txt
onDockerfile
My
docker-compose.yml
looks like:version: '2' services: web: build: web/ ports: - "8080:80" volumes: - ./web/:/var/www/ env_file: - web/.env
I execute
docker-compose up --build
- I then do
docker exec -it <container id> bash
- I
cd
to the folder/var/www/public
and the filetext.txt
is not there