安装完docker以后,肯定要下载镜像,从默认配置的话基本上不无法使用的,
修改:
[root@localhost ~]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["http://f2d6cb40.m.daocloud.io"]
}{}
[root@localhost ~]#
下载centos镜像:
[root@localhost yum.repos.d]# docker pull centos
启动centos镜像:
[root@localhost yum.repos.d]# docker run -i -t centos /bin/bash
这样就可以使用了:
[root@localhost yum.repos.d]# docker run -i -t centos /bin/bash
[root@f6ccd042f4c9 /]# cat /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.2 f6ccd042f4c9
[root@f6ccd042f4c9 /]#