starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory":

HellBoy13

I am trying to build an docker image on centos 7 from SCRATCH. I have performed following steps :

FROM scratch
RUN rpm -ivh https://address/app.rpm
RUN YUM install tools 
...
...
CMD ["rpm","start"]

After executing this , I tried to build this dockerfile with command "docker build -t testsid -f ./dockerfile ."

Now I see following error :

Sending build context to Docker daemon  3.072kB
Step 1/16 : FROM scratch
 --->
Step 2/16 : RUN rpm -ivh https://address/app.rpm
 ---> Running in d25a0a879d9e
OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown

Please let me know whether anyone has suggestion regarding this. ?

Any input will be really helpful.

Thank you.

David Maze

FROM scratch starts from a totally empty image. The only things that will be in the container filesystem at all are files in /dev, /proc, and /etc that Docker automatically provides. When you say rpm, that command doesn't exist. A string-form RUN command gets wrapped in /bin/sh -c ..., but there is no /bin directory.

FROM scratch is a somewhat advanced use of Docker. If you're very comfortable with concepts like statically-linked binaries and the differences between bare-string and JSON-array CMD, you can use it to make an extremely small image. For most typical uses you'll want to at least start from something with some sort of distribution and package manager.

If you need Red Hat's package management tools, the easiest Docker Hub image to start from will be centos:

FROM centos:8 # includes rpm, yum, /bin directory
RUN rpm -ivh https://address/app.rpm
RUN yum install tools
...

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

standard_init_linux.go:178: exec user process caused "exec format error"

starting container process caused "exec: > \"exec\": executable file not found in $PATH": unknown

OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"xxxx\": executable file not found in $PATH": unknown

starting container process caused "exec: \"/app\": permission denied": unknown

Starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown

OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"-it\": executable file not found in $PATH":unknown

Cannot start service prometheus: oci runtime error: container_linux.go:235: starting container process caused "container init exited prematurely"

Starting container process caused "exec: \\"tail -f /dev/null\\": stat tail -f /dev/null: no such file or directory

Error: Starting container process caused "exec: \"/docker-entrypoint.sh\": permission denied"

OCI runtime exec failed: exec failed: container_linux.go:344: starting container process

Error running docker container: starting container process caused "exec: \"python\": executable file not found in $PATH": unknown

Starting container process caused "exec: \"/tmp/run.sh\": permission denied": unknown

Container ECS EC2 not starting with `running exec setns process for init caused \"exit status 23\"": unknown`

starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown

starting container process caused "exec: \"/tmp/installer.sh\": permission denied"

Weird Error in kubernetes: "starting container process caused "exec: \"/usr/bin/dumb-init\": stat /usr/bin/dumb-init: no such file or directory"

cannot create /etc/nginx/nginx.conf: Directory nonexistent and starting container caused "exec: \"supervisord\": executable file not found in $PATH"

docker buildx "exec user process caused: exec format error"

docker run results in starting container process caused "exec: \"./boot.sh\": permission denied

Hyperledger - container_linux.go:349 starting container process caused "no such file or directory": unknown

docker compose exec user process caused: no such file or directory

starting container process caused: exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown

Docker Error response from daemon: OCI runtime create failed container_linux.go:380: starting container process caused

Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "python":

Docker error: standard_init_linux.go:228: exec user process caused: exec format error

Running a docker Image of Golang failed, with error 'starting container process caused: exec: "/path": permission denied'

Docker Go image: starting container process caused: exec: "app": executable file not found in $PATH: unknown

Debug Golang in containers with delve: container_linux.go:380: starting container process caused: exec: "/dlv": stat /dlv: no such file or directory

starting container process caused: exec: "/bin/sh": stat /bin/sh: no such file or directory ---- executor failed running [/bin/sh -c