Docker 容器在退出时消失
Docker container disappears upon exiting
容器是使用命令创建的
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" \
但是在退出和 运行 docker ps -a
时,容器没有列出,看起来容器只是临时创建的。这在我以前使用 docker 的经验中没有发生过,可能是什么原因?
--rm
选项告诉 docker 运行 命令在容器自动退出时删除容器。
容器是使用命令创建的
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" \
但是在退出和 运行 docker ps -a
时,容器没有列出,看起来容器只是临时创建的。这在我以前使用 docker 的经验中没有发生过,可能是什么原因?
--rm
选项告诉 docker 运行 命令在容器自动退出时删除容器。