Solve the problem of ifconfig being unavailable in docker

Solve the problem of ifconfig being unavailable in docker

Recently, when I was learning docker, I found that ifconfig was used to query the network status in the docker container.

The command not found message appeared. After searching the information, I learned that the images on Docker are installed in the lightest way, and some commands need to be installed by yourself.

Solution:

yum install net-tools

If yum is not available, you can use apt-get install net-tools to solve it

Supplement: Install vim, telnet, ifconfig commands in docker container

When using a docker container, sometimes vim is not installed in it, and when you type the vim command, it prompts: vim: command not found. At this time, you need to install vim, but when you type the apt-get install vim command, it prompts:

Reading package lists... Done

Building dependency tree

Reading state information... Done

E: Unable to locate package vim

At this time, you need to type: apt-get update,

The purpose of this command is to synchronize the indexes of the sources listed in /etc/apt/sources.list and /etc/apt/sources.list.d so that the latest software packages can be obtained.

After the update is complete, type the command: apt-get install vim.

apt-get install telnet Install telnet
apt-get install net-tools Install ifconfig

The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. If there are any mistakes or incomplete considerations, please feel free to correct me.

You may also be interested in:
  • Docker sets up port mapping, but cannot access the solution
  • How to configure Jupyter notebook in Docker container
  • Docker volume deletion operation
  • The difference between VOLUME and docker -v in Dockerfile
  • Docker implements container port binding local port
  • Docker enables multiple port mapping commands
  • How to install Postgres 12 + pgadmin in local Docker (support Apple M1)

<<:  Detailed explanation of the idea of ​​implementing dynamic columns in angularjs loop object properties

>>:  Solution for applying CSS3 transforms to background images

Recommend

Three methods of inheritance in JavaScript

inherit 1. What is inheritance Inheritance: First...

Implementation of Vue3 style CSS variable injection

Table of contents summary Basic Example motivatio...

HTML+VUE paging to achieve cool IoT large screen function

Effect demo.html <html> <head> <me...

Detailed steps to install web server using Apache httpd2.4.37 on centos8

Step 1: yum install httpd -y #Install httpd servi...

How to solve the phantom read problem in MySQL

Table of contents Preface 1. What is phantom read...

How to recover data after accidentally deleting ibdata files in mysql5.7.33

Table of contents 1. Scenario description: 2. Cas...

What is COLLATE in MYSQL?

Preface Execute the show create table <tablena...

In-depth analysis of MySQL query interception

Table of contents 1. Query Optimization 1. MySQL ...

vue+springboot realizes login function

This article example shares the specific code of ...

Pure CSS to achieve cool neon light effect (with demo)

I have recently been following the CSS Animation ...

Convert XHTML CSS pages to printer pages

In the past, creating a printer-friendly version ...

Tutorial on installing MYSQL8.0 on Alibaba Cloud ESC

Open the connection tool. I use MobaXterm_Persona...

MySQL 8.0.21 installation and configuration method graphic tutorial

Record the installation and configuration method ...

In-depth understanding of Worker threads in Node.js

Table of contents Overview The history of CPU-bou...