【docker】Error response from daemon Container is not running

今天,拉取了同事更新的 docker image,在执行实例化 container 脚本后,执行

docker container ls -a
docker container start [container_name]
docker exec -it -u root [container_name] /bin/bash

在进入 container 时,出现闪退现象

再执行

docker container ls -a

显示 container 1秒前退出

CONTAINER ID	IMAGE	COMMAND 	CREATED 	 STATUS PORTS  		NAMES
314957EAD6B3 	apollo	"/bin/bash"	1 hourse ago EXITED(1 second)	project_apollo

使用的 实例化 container 脚本是:

#! /bin/sh
DOCKER_IMAGE="apollo:6.0.0"
CONTAINER="apollo_x86_test"
MAP_DIR="/mnt/${user_name}"

echo "creating container" $CONTAINER "with image" $DOCKER_IMAGE
echo "creating container"
docker run -idt -u $(id -u) \
	--name $CONTAINER \
	--privileged  \
	--cap-add SYS_ADMIN \
	--cap-add NET_ADMIN \
	--device /dev/fuse \
	--security-opt apparmor:unconfined \
	--security-opt seccomp=unconfined \
	--net=host \
	-v /dev/bus/usb:/dev/bus/usb \
	-v $MAP_DIR:/home \
	-v /etc/passwd:/etc/passwd $DOCKER_IMAGE bash

换了如下 container 脚本就可以正常进入 docker container 中

#! /bin/sh
DOCKER_IMAGE="apollo:6.0.0"
CONTAINER="apollo_x86_test"
MAP_DIR="/mnt/${user_name}"

docker run --entrypoint /bin/bash \
--gpus all \
-it \
-e CAR_ID=$CAR_ID \
-e LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/opt/usr/third_party/TensorRT-8/lib \
-v $MAP_DIR:/data \
-v /data/log:/data/log \
-v /opt/cfg:/opt/usr/cfg \
-v /opt/models:/opt/usr/models \
-v /opt/hdmap:/opt/usr/hdmap \
--net host \
--privileged \
-w /[project] \
--name $CONTAINER_NAME \
$DOCKER_IMAGE \

你可能感兴趣的:(docker)