docker:安裝centos7映象(六)
拉取映象
[root@localhost local]# docker pull centos:7
7: Pulling from library/centos
75f829a71a1c: Pull complete
Digest: sha256:19a79828ca2e505eaee0ff38c2f3fd9901f4826737295157cc5212b7a372cd2b
Status: Downloaded newer image for centos:7
docker.io/library/centos:7
檢視
[root@localhost local]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos 7 7e6257c9f8d8 2 months ago 203MB
hello-world latest bf756fb1ae65 9 months ago 13.3kB
啟動映象
啟動映象centos7,如果不指定 /bin/bash,容器執行後會自動停止
[root@localhost ~]# docker run -d -i -t <IMAGE ID> /bin/bash
進入容器
[root@localhost ~]# docker exec -it <CONTAINER ID> bash
進入後發現沒有ifconfig,直接yum安裝
[root@22a91333c6ad /]# yum install -y net-tools
如果無法ping外網,重建docker0網路
[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
相關文章
- CentOS7安裝Docker並配置映象加速CentOSDocker
- CentOS7 切換阿里映象源並安裝 dockerCentOS阿里Docker
- docker安裝mysql映象DockerMySql
- CentOS7 安裝 dockerCentOSDocker
- centos7安裝dockerCentOSDocker
- Centos7安裝安裝部署dockerCentOSDocker
- centos7安裝社群版docker並配置阿里雲映象加速CentOSDocker阿里
- centos 下docker映象安裝CentOSDocker
- centos7 docker 安裝教程CentOSDocker
- centos7快速安裝dockerCentOSDocker
- centOs7安裝最新dockerCentOSDocker
- Centos7上安裝dockerCentOSDocker
- centos7下docker安裝CentOSDocker
- centos7下安裝 dockerCentOSDocker
- Centos7安裝Docker EngineCentOSDocker
- Centos7下安裝DockerCentOSDocker
- Centos7 yum安裝 DockerCentOSDocker
- ubuntu 使用aliyun映象安裝 dockerUbuntuDocker
- CentOS7 docker docker-Composer 安裝CentOSDocker
- Centos7 安裝Docker,常用命令,設定國內阿里雲映象,並且在docker中安裝MysqlCentOSDocker阿里MySql
- Docker中使用CentOS7映象DockerCentOS
- CentOS7 docker安裝部署教程CentOSDocker
- Docker-CE 安裝(centos7)DockerCentOS
- 在Centos7上安裝DockerCentOSDocker
- Centos7下解除安裝dockerCentOSDocker
- 不用安裝docker也能構建docker映象Docker
- Centos7 安裝 Docker 詳細教程CentOSDocker
- CentOS7上安裝和使用DockerCentOSDocker
- Centos7編譯安裝Docker教程。CentOS編譯Docker
- centos7 安裝docker-composeCentOSDocker
- Centos7安裝docker倉庫HarborCentOSDocker
- centos7安裝docker詳細教程CentOSDocker
- Docker架構及在Centos7上安裝dockerDocker架構CentOS
- 安裝 Docker-yum-阿里雲映象Docker阿里
- CentOS7利用docker安裝MySQL5.7CentOSDockerMySql
- CentOS7下安裝Docker-ComposeCentOSDocker
- VMware安裝映象Centos7,並連線XshellCentOS
- Ubuntu安裝和配置Docker-CE映象加速UbuntuDocker