User Tools

Site Tools


ubuntu:docker:ping_command_not_found

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ubuntu:docker:ping_command_not_found [2020/02/29 21:26] – created peterubuntu:docker:ping_command_not_found [2020/04/15 21:43] (current) – removed peter
Line 1: Line 1:
-====== Ubuntu - Docker - Ping command not found ====== 
- 
-Docker container running Ubuntu which I did as follows: 
- 
-<code bash> 
-docker run -it ubuntu /bin/bash 
-</code> 
- 
-returns: 
- 
-<code bash> 
-bash: ping: command not found 
-</code> 
- 
----- 
- 
- 
-Docker images are pretty minimal, But you can install ping in your official Ubuntu docker image via: 
- 
-<code bash> 
-apt-get update 
-apt-get install iputils-ping 
-</code> 
- 
-Chances are you don't need ping your image, and just want to use it for testing purposes. Above example will help you out. 
- 
-But if you need ping to exist on your image, you can create a Dockerfile or commit the container you ran the above commands in to a new image. 
- 
-Commit: 
- 
-<code bash> 
-docker commit -m "Installed iputils-ping" --author "Your Name <name@domain.com>" ContainerNameOrId yourrepository/imagename:tag 
-</code> 
- 
-Dockerfile: 
- 
-<code file> 
-FROM ubuntu 
-RUN apt-get update && apt-get install -y iputils-ping 
-CMD bash 
-</file> 
- 
-Please note there are best practices on creating docker images, Like clearing apt cache files after and etc. 
  
ubuntu/docker/ping_command_not_found.1583011573.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki