Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (2.3k points)
edited by

So I've been trying to ping from one ubuntu container to another but I keep getting this message when I try to use the ping :

bash: ping: command not found

shouldn't it already have it? its pretty basic.

1 Answer

0 votes
by (6.9k points)

Ping is not installed on docker images by default as they are have minimal functionalities, you will have to install it for it to work:

apt-get update
apt-get install iputils-ping

 You can add the ping command to you dockerfile while you are creating your image so you don't have to install it everytime you want to use ping on your containers. Just write these instructions in your dockerfile:

FROM ubuntu
RUN apt-get update && apt-get install -y iputils-ping
CMD bash

Learn more on how to work with docker containers and docker images through docker training course where you will be taught by industry professionals.

Related questions

Browse Categories

...