0

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.

1 Answer 1

1

It's by design, when you start a container, it runs in its own virtual environment until you stop and remove it. Or, add --rm to automatically remove the container when it exits.

1
  • Makes sense - cheers.
    – quant
    Commented Sep 19, 2020 at 8:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .