Please help me understand where the new folder is created. When I docker exec -it <mycontainer> bash
the container, the created folder is not there.
Dockerfile:
FROM python:3.7-alpine
WORKDIR /app
RUN pip install -r requirements.txt
RUN mkdir -p /new_folder
COPY . .
CMD ["gunicorn", "-w 4", "main:app"]
I also tried copying the local stuff before creating a new folder, still can’t see the folder created in the container.
2
Answers
your working directory is /app and you are copying files from your current dierctory to /app. when your container is running do this
you’ll see /app in output
but you are creating new_folder as a root directory. so you can’t see it inside /app
to see your root directories you can run this:
also my Dockerfile is this:
Your folder is created at the filesystem root :
/
try
docker exec -it <mycontainer> bash
and then, in the container,ls /