I want to copy a file from container to my local. The file is generated after execute python script, but due to then ENTRYPOINT
, the container exited right after it run, and cant be able to use docker cp
command. Any idea on how to prevent
the container from exit before manage to copy the file? Below is my Dockerfile:
FROM python:3.9-alpine3.12
WORKDIR /app
COPY . /app/
RUN pip install --no-cache-dir -r requirements.txt && \
rm -f /var/cache/apk/*
ENTRYPOINT ["python3", "main.py"]
I use this command to run the image:
docker run -d -it --name test [image]