dengnan123 / Daily_Record

记录日常点滴知识点
2 stars 0 forks source link

进去正在运行的某个docker 容器报错(OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown) #45

Open dengnan123 opened 4 years ago

dengnan123 commented 4 years ago

docker container ls

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
88bad6a2c9a1        jm113               "/bin/sh -c 'PORT=30…"   13 hours ago        Up 13 hours         0.0.0.0:3000->3000/tcp   nifty_khayyam
150a3d1c3f68        jm9                 "/bin/sh -c 'PORT=${…"   16 hours ago        Up 16 hours         0.0.0.0:3236->3234/tcp   trusting_spence
5609cb4ac115        jm9                 "/bin/sh -c 'PORT=${…"   16 hours ago        Up 16 hours         0.0.0.0:3234->3234/tcp   musing_wiles
11ec0b238308        jm9                 "/bin/sh -c 'PORT=${…"   16 hours ago        Up 16 hours         0.0.0.0:3233->3000/tcp   jolly_greider

然后 docker exec -it 88bad6a2c9a1 /bin/bash就报错了

OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown

去查了下在这个issue里面找到了答案https://github.com/docker/for-linux/issues/246 如下

image

use /bin/sh instead of /bin/bash

Bob4F commented 4 years ago

thank you