docker tutorials

Docker: Error response from daemon: OCI runtime create failed: container_linux.go:349

This tutorial guides you on how to resolve the following issue Docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused “exec: \”ping\”: executable file not found in $PATH”: unknown.

Docker: Error response from daemon: OCI runtime create failed

While running the following docker run command it failed with below error response. From the response it is clear that OCI runtime create failed i.e., unable to start the container process because it cannot find “ping” in the container.

[email protected]:~ (sneppets-gcp)$ docker run --rm ubuntu ping
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
692c352adcf2: Pull complete
97058a342707: Pull complete
2821b8e766f4: Pull complete
4e643cc37772: Pull complete
Digest: sha256:55cd38b70425947db71112eb5dddfa3aa3e3ce307754a3df2269069d2278ce47
Status: Downloaded newer image for ubuntu:latest
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"ping\": executable file not found in $PATH": unknown.
ERRO[0010] error waiting for container: context canceled

In order to resolve the above issue, you need to install ping utility using apt-get with the help of interactive commands. To install ping utility you need to get to bash of our container. For example, if you wanted to run bash in our container we need to use the following options in the docker run command as shown below.

$ docker run --rm -i -t ubuntu bash

[email protected]:/# echo hello world
hello world

Interactive Commands

-i -> interactive
-t -> to emulate the text terminal

$ docker run –rm -i -t

The above  command operates more likely in a new terminal

Then you can install ping from bash using the following apt-get commands. First, run apt-get update command.

[email protected]:/# apt-get update
Get:1 focal-security InRelease [107 kB]
Get:2 focal InRelease [265 kB]
Get:3 focal-security/multiverse amd64 Packages [1077 B]
Get:4 focal-security/universe amd64 Packages [44.5 kB]
Get:5 focal-security/main amd64 Packages [164 kB]
Get:6 focal-updates InRelease [111 kB]        
Get:7 focal-security/restricted amd64 Packages [33.9 kB]
Get:8 focal-backports InRelease [98.3 kB]
Get:9 focal/universe amd64 Packages [11.3 MB]
Get:10 focal/multiverse amd64 Packages [177 kB]
Get:11 focal/restricted amd64 Packages [33.4 kB]
Get:12 focal/main amd64 Packages [1275 kB]
Get:13 focal-updates/universe amd64 Packages [157 kB]
Get:14 focal-updates/restricted amd64 Packages [33.9 kB]
Get:15 focal-updates/main amd64 Packages [310 kB]
Get:16 focal-updates/multiverse amd64 Packages [4224 B]
Get:17 focal-backports/universe amd64 Packages [3209 B]
Fetched 14.2 MB in 5s (2774 kB/s)
Reading package lists... Done

Afterwards, run the following apt-get install command

[email protected]:/# apt-get install iputils-ping

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libcap2 libcap2-bin libpam-cap
The following NEW packages will be installed:
  iputils-ping libcap2 libcap2-bin libpam-cap
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 90.5 kB of archives.
After this operation, 333 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 focal/main amd64 libcap2 amd64 1:2.32-1 [15.9 kB]
Get:2 focal/main amd64 libcap2-bin amd64 1:2.32-1 [26.2 kB]
Get:3 focal/main amd64 iputils-ping amd64 3:20190709-3 [40.1 kB]
Get:4 focal/main amd64 libpam-cap amd64 1:2.32-1 [8352 B]
Fetched 90.5 kB in 1s (76.2 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libcap2:amd64.
(Reading database ... 4122 files and directories currently installed.)
Setting up iputils-ping (3:20190709-3) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...

Finally, ping Now you should be able to ping.

[email protected]:/# ping
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=113 time=1.22 ms
64 bytes from ( icmp_seq=2 ttl=113 time=1.27 ms
64 bytes from ( icmp_seq=3 ttl=113 time=1.32 ms
64 bytes from ( icmp_seq=4 ttl=113 time=1.09 ms
--- ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 1.089/1.224/1.324/0.087 ms

You can also do require changes in the container and can commit back the changes (ping utility installation) that is done to the file system back to the docker image.

Hope it helped 🙂

Also See:


Leave a Reply

Notify of