Method: 1. Use "docker exec -it container name/bin/bash" to enter the container; 2. Use "apt update && apt install -y iproute2" to update the command resources; 3. Execute "apt-" sequentially get update", "apt install net-tools" and "apt install iputils-ping" commands; 4. Use "exit" to exit the container and re-execute the command.
The operating environment of this tutorial: linux7.3 system, docker version 19.03, Dell G3 computer.
Error log
When I use ping, an OCI error is reported:
OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "ping": executable file not found in $PATH: unknown
Solution
1. Enter the container
# docker exec -it 容器名 /bin/bash docker exec -it tomcat01 /bin/bash
2. Update the command resource
ip addr
apt update && apt install -y iproute2
ping
3. The following needs to be executed one by one in order
apt-get update apt install net-tools # ifconfig apt install iputils-ping# ping
4. After the update is completed, exit the container and execute it again The required command
exit
You can see that it was successful at this time!
Recommended learning: "docker video tutorial"
The above is the detailed content of How to solve oci error in docker. For more information, please follow other related articles on the PHP Chinese website!