Python development environment in the container
Software to install
Use dockerhub to find proper images
Examples
1 | docker pull jupyter/datascience-notebook |
Now we can build and run the container and target it to local folder for output files
1 | docker run -it -p 8888:8888 -v D:/Code/Python/Grokking_ML/jupiter_notebooks:/home/jovyan/projects jupyter/datascience-notebook |
where arguments are port to listen, folder to target and container to run
-v paramter here has next format -v {host_path}:{container_path}
with container running this way you can either work with jupiter notebook through your browser or using VSCode you can open remote window by
attaching to running container and with jupiter extension write code directly from VSCode
Alternative method
For alternative method we would rely on anaconda docker containers
Next step is to create docker container, we will use it to attach through VSCode and work from created environment
1 | # For more information, please refer to https://aka.ms/vscode-docker-python |
Additionally there are usefull tasks for vscode to automate
1 | { |