Home > Operation and Maintenance > Docker > How docker install centos image

How docker install centos image

王林
Release: 2020-04-14 15:06:01
Original
2762 people have browsed it

How docker install centos image

1. Pull the centos7 image

[root@localhost ~]# docker pull centos:7
Copy after login

2. Start the centos7 image. If /bin/bash is not specified, the container will automatically stop after running

[root@localhost ~]# docker run -d -i -t <IMAGE ID> /bin/bash
Copy after login

3. Enter the container

[root@localhost ~]# docker exec -it <CONTAINER ID> bash
Copy after login

4. After entering, you find that there is no ifconfig, install it directly with yum

How docker install centos image

[root@8f10fbd6bd5a /]# yum install -y net-tools
Copy after login

5 , Unable to ping the external network, find the information and rebuild the docker0 network to solve the problem

[root@localhost ~]# pkill docker
[root@localhost ~]# iptables -t nat -F
[root@localhost ~]# ifconfig docker0 down
[root@localhost ~]# brctl delbr docker0
[root@localhost ~]# systemctl restart docker
[root@localhost ~]# docker start <CONTAINER ID>
Copy after login

Recommended tutorial: docker tutorial

The above is the detailed content of How docker install centos image. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
About docker
From 1970-01-01 08:00:00
0
0
0
docker install phpstudy
From 1970-01-01 08:00:00
0
0
0
Deploy snmp environment in docker
From 1970-01-01 08:00:00
0
0
0
docker: invalid reference format
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template