Docker: Python Development mode with mounted directory
FROM python:3.8 RUN pip3 install requests # COPY curl.py . # ENTRYPOINT ["python3", "curl.py"]
$ docker build -t mydocker . $ docker run --rm -v $(pwd):/opt/ mydocker python /opt/curl.py https://httpbin.org/get
- You can edit the file on your host system (with your IDE) and run it on the command line of the Docker container.
- A better way to mount the current working directory, at least on Linux and OSX