Cannot run Container (ExitCode:127) - How to debug this issue?

Hi guys,

I know, this ExitCode:127 Error occures when a command cannot be found. But in my case, I’m not using a special Dockerfile. I’m just pulling the latest Ubunutu and I’m tyring to run this container.

root@hpx-xr:~# docker --version
Docker version 20.10.8-ce, build 62eae52c2a

OS: Xilinx PetaLinux 2022.1 (Yocto Honister Release)

root@xr:~# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE

root@xr:~# docker pull ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu
cd741b12a7ea: Pull complete
Digest: sha256:67211c14fa74f070d27cc59d69a7fa9aeff8e28ea118ef3babc295a0428a6d21
Status: Downloaded newer image for ubuntu:latest
docker.io/library/ubuntu:latest

root@xr:~# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest bab8ce5c00ca 3 weeks ago 69.2MB

root@xr:~# docker run -it ubuntu /bin/bash
[ 208.482634] docker0: port 1(veth8697c54) entered blocking state
[ 208.488620] docker0: port 1(veth8697c54) entered disabled state
[ 208.494789] device veth8697c54 entered promiscuous mode
[ 209.560717] eth0: renamed from vethd8acfae
[ 209.580232] IPv6: ADDRCONF(NETDEV_CHANGE): veth8697c54: link becomes ready
[ 209.587253] docker0: port 1(veth8697c54) entered blocking state
[ 209.593185] docker0: port 1(veth8697c54) entered forwarding state
[ 209.599534] IPv6: ADDRCONF(NETDEV_CHANGE): docker0: link becomes ready
[ 209.746784] docker0: port 1(veth8697c54) entered disabled state
[ 209.752879] vethd8acfae: renamed from eth0
[ 209.822251] docker0: port 1(veth8697c54) entered disabled state
[ 209.830013] device veth8697c54 left promiscuous mode
[ 209.835081] docker0: port 1(veth8697c54) entered disabled state
docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: “/bin/bash”: stat /bin/bash: no such file or directory: unknown.
ERRO[0007] error waiting for container: context canceled

Could you please tell me how to debug this issue?

Thanks and best regards
Frank

Hello.

First of all, the downloaded obuntu:latest image may not have /bin/bash due to an error, so please check the following command to see if there is /bin/bash in the image.

docker run -it ubuntu which bash

If it doesn’t work, I think there’s a problem with the image, so please delete the image with the following command and pull it again

docker rmi ubuntu:latest
docker pull ubuntu:latest