Installing ping tools in the container built by Docker

  • 2021-09-16 08:32:48
  • OfStack

Because Base images pulled by Docker, such as Centos and Ubuntu, are the simplest versions and do not include Ping tools, Ping tools are often used to test the network between the two containers when linking Docker to Docker, network and Docker, and Ping tools are needed at this time.

Here are the commands to install the Ping tool under 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 issues

Summarized some problems on the Internet

On the Windows environment, part 1 is converted into unix because the file type is dos, and then compiled.

You need to install the dos2unix dos2unix file

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

Add CGO_ENABLED=0 to dockerfile

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

In the end, there is really no way

There is no problem changing the basic image from alpine to from centos

But this image file is relatively large

Related articles: