Docker hands-on with Linux containers on Windows 10. Part 1.
Docker tips as a future reference for myself.
* Stop all containers (won't work from Windows cmd, only from Linux shells or git bash on Windows):
docker stop $(docker ps -aq)
ps -aq returns a list of containers' ID's only
* Remove all containers:
docker rm $(docker ps -aq)
* Mount a volume on a local machine. In other words: map container's internal folder to a physical folder (on local machine).
This is required when an application inside a docker container must write or/and read from the file outside its container, e.g. located in some local folder. First, in Docker -> Settings -> Shared Drives, enable drive sharing for the drive you want to use (C:, D:, etc.).
Under Windows it must be done from cmd and not from git bash as it will try to interpret container's internal folder as its own. Suppose, your Python program inside the container writes to /home_dir/app_dir/output_file.csv, then the mount will look like:
docker run -v c:/path_to_folder/you_want_your_file_to_be/outpt_file.csv:/home_dir/app_dir/output_file.csv <image_name>
To be continued...