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安裝社群版docker並配置阿里雲映象加速CentOSDocker阿里
- Centos7安裝安裝部署dockerCentOSDocker
- CentOS7 安裝 dockerCentOSDocker
- centos7安裝dockerCentOSDocker
- centos 下docker映象安裝CentOSDocker
- CentOS7 docker docker-Composer 安裝CentOSDocker
- centos7快速安裝dockerCentOSDocker
- Centos7上安裝dockerCentOSDocker
- centos7 docker 安裝教程CentOSDocker
- centos7下安裝 dockerCentOSDocker
- centOs7安裝最新dockerCentOSDocker
- centos7下docker安裝CentOSDocker
- Centos7 安裝Docker,常用命令,設定國內阿里雲映象,並且在docker中安裝MysqlCentOSDocker阿里MySql
- ubuntu 使用aliyun映象安裝 dockerUbuntuDocker
- 在Centos7上安裝DockerCentOSDocker
- CentOS7 docker安裝部署教程CentOSDocker
- Docker-CE 安裝(centos7)DockerCentOS
- 不用安裝docker也能構建docker映象Docker
- 安裝 Docker-yum-阿里雲映象Docker阿里
- Docker中使用CentOS7映象DockerCentOS
- Centos7編譯安裝Docker教程。CentOS編譯Docker
- centos7安裝docker詳細教程CentOSDocker
- Centos7安裝docker倉庫HarborCentOSDocker
- CentOS7上安裝和使用DockerCentOSDocker
- Centos7 安裝 Docker 詳細教程CentOSDocker
- VMware安裝映象Centos7,並連線XshellCentOS
- Docker架構及在Centos7上安裝dockerDocker架構CentOS
- Centos7安裝jenkins+docker部署tomcatCentOSJenkinsDockerTomcat
- CentOS7利用docker安裝MySQL5.7CentOSDockerMySql
- Linux(Centos7)安裝Docker 社群(ce)版LinuxCentOSDocker
- Centos7 阿里雲映象 2207-02 下安裝docker-compose後,docker-compose version 命令失效問題CentOS阿里Docker
- CentOS7使用Docker安裝STF安卓裝置管理平臺CentOSDocker安卓
- Ubuntu安裝和配置Docker-CE映象加速UbuntuDocker
- 一行命令安裝docker和docker-compose(CentOS7)DockerCentOS
- 將本地安裝的Python庫整合到Docker映象PythonDocker