On attempting to create a docker container from a supplied image I see the following error.
Note: I had to condense or remove the unnecessary information as they relate to proprietary software.
siddy@dev1:~/may18$ docker run --init artifactory_url/image_dir/image:image_ver
docker: Error response from daemon: exec: “docker-init”: executable file not found in $PATH.
FYI -
siddy@dev1:~/may18$ docker version
Client: Docker Engine - Community
Version: 23.0.4
API version: 1.41 (downgraded from 1.42)
Go version: go1.19.8
Git commit: f480fb1
Built: Fri Apr 14 10:32:23 2023
OS/Arch: linux/amd64
Context: default
The error message is coming from the Docker daemon, which means that it is not enough for you to have it in the PATH in the docker client’s shell. The daemon needs that executable to copy into the container and use as an init process /usr/bin is usually already in the path for every user as you had too, but if the Docker daemon can’t find it then it seems the variable was somehow overridden for the daemon. Maybe in the systemd unit’s config or docker-init is not in that folder. What is your operating system and how did you install Docker exactly?
Please share links if you have.
Note: If you use the code block button </> instead of quoting the forum will not change the intentation and style of your shared code.
I recently experienced the same thing. The docker-init binary wasn’t anywhere to be found on the host system. Reinstalling/Upgrading didn’t help. The one thing that helped was to chmod 755 /usr/libexec/docker/docker-init and that made it persist and then I was able to restart all my containers.