Docker - Writing python output to a csv file in the current working directory Docker - Writing python output to a csv file in the current working directory python-3.x python-3.x

Docker - Writing python output to a csv file in the current working directory


You can bind your host directory, I would suggest using a WORKDIR & replace ADD with COPY -

DOCKERFILE

FROM python:3WORKDIR /mydataCOPY scraper.py ./RUN pip install pandasCMD ["python3","./scraper.py"]

Run it -

docker run -v ${PWD}:/data ex_scraper

You should now be able to see the CSV in your current directory on host.