I have a batch file that I use to start a docker container in windows, in this case to start up a jupyter notebook:
@echo off
SET RootPath=C:/Path/To/Working/Folder
docker run -p 8888:8888 -v %RootPath%:/mnt/env container_name jupyter lab --port 8888 --ip=0.0.0.0 --allow-root --NotebookApp.notebook_dir=/mnt/env
This works fine, but if I close the command prompt where the batch file is running, my docker container keeps running. Why does this happen, and how to achieve the expected behaviour of the job being killed as soon as I close the command prompt?
I am running Docker 2.3.0.3.