服务器运维方向

Docker中使用CentOS7镜像

2018-12-29  本文已影响0人  阿休

使用docker安装centos

docker pull centos
docker images
docker run -d -i -t <imageID> /bin/bash

这样就能启动一个一直停留在后台运行的Centos了。如果少了/bin/bash的话,Docker会生成一个Container但是马上就停止了,不会一致运行即使有了-d参数。

然后我们可以进入我们这个Centos

docker attach <ContainerID>

进入Centos后,发现竟然没有ifconfig和ssh,网上例子很多参照着来

1、ifconfig的安装,执行命令

yum search ifconfig

2、安装ifconfig

yum install net-tools.x86_64

3、查看ip

ifconfig
查看IP信息

4、OpenSSL is not properly installed on your system

 yum -y install openssl-devel
上一篇 下一篇

猜你喜欢

热点阅读