Docker container disappears upon exiting

The container was created with the commands

docker run --gpus '"'device=$CUDA_VISIBLE_DEVICES'"' --ipc=host --rm -it \
    --mount src=$(pwd),dst=/clipbert,type=bind \
    --mount src=$OUTPUT,dst=/storage,type=bind \
    --mount src=$PRETRAIN_DIR,dst=/pretrain,type=bind,readonly \
    --mount src=$TXT_DB,dst=/txt,type=bind,readonly \
    --mount src=$IMG_DIR,dst=/img,type=bind,readonly \
    -e NVIDIA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES \
    -w /clipbert jayleicn/clipbert:latest \
    bash -c "source /clipbert/setup.sh && bash" \

But upon exit and running docker ps -a, the container is not listed and it seems like the container is only temporarily created. This has not happened in my previous experience with docker, what may the reason be?

>Solution :

The --rm options tells docker run command to remove the container when it exits automatically.

Leave a Reply