Installing the ping tool in a container built by Docker

Installing the ping tool in a container built by Docker

Because the Base images pulled by Docker, such as Centos and Ubuntu, are the simplest versions and do not contain the Ping tool. When performing Docker network and Docker link operations on Docker, the Ping tool is often used to test the network between two containers. At this time, the Ping tool is needed.

Below is the command to install the Ping tool in Ubuntu:

sudo apt-get update && apt-get install iputils-ping

Additional knowledge: standard_init_linux.go:211: exec user process caused "no such file or direct" problem

Summarizes some issues on the Internet

In Windows environment, because the file type is DOS, just convert it to Unix and then compile it.

Need to install dos2unix dos2unix file

This problem does not exist on Mac, you need to disable cgo

Add CGO_ENABLED=0 in dockerfile

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build .

In the end, there is really no way

Changing the base image from alpine to from centos will solve the problem

But this image file is relatively large

The above article on installing the ping tool in the container built by Docker is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed steps to install 64-bit Ubuntu system and Docker tool on Raspberry Pi 3B+
  • How to install and configure the Docker Compose orchestration tool in Docker.v19
  • 5 super useful open source Docker tools highly recommended

<<:  HTML Tutorial: Unordered List

>>:  Example of using MRG_MyISAM (MERGE) to implement query after partitioning in MySQL

Recommend

Cross-database association query method in MySQL

Business scenario: querying tables in different d...

Win10 install Linux ubuntu-18.04 dual system (installation guide)

I installed a Linux Ubuntu system on my computer....

A brief discussion on the solution of Tomcat garbled code and port occupation

Tomcat server is a free and open source Web appli...

Vue3 draggable left and right panel split component implementation

Table of contents Breaking down components Left P...

Minimalistic website design examples

Web Application Class 1. DownForEveryoneOrJustMe ...

The table merges cells and the img image to fill the entire td HTML

Source code (some classes deleted): Copy code The ...

Why should you be careful with Nginx's add_header directive?

Preface As we all know, the nginx configuration f...

Linux yum package management method

Introduction yum (Yellow dog Updater, Modified) i...

vue $set implements assignment of values ​​to array collection objects

Vue $set array collection object assignment In th...

Detailed explanation of Vue's methods and properties

Vue methods and properties 1. Methods Usage 1 met...

A brief discussion on the principle of shallow entry and deep exit of MySQL

Table of contents 1. Overview of the page 2. Infi...

Mobile browser Viewport parameters (web front-end design)

Mobile browsers place web pages in a virtual "...

Setting up a proxy server using nginx

Nginx can use its reverse proxy function to imple...