CentOS7安装docker运行kali linux镜像

本文介绍如何在CentOS 7.2系统中安装Docker并启动服务,通过命令展示Docker服务的状态,从Docker仓库拉取Kali Linux镜像,查看镜像信息,并启动容器进入Kali Linux环境。
摘要由CSDN通过智能技术生成
操作系统版本:CentOS 7.2.1511
yum install docker //安装docker程序


systemctl start docker //启动docker服务
systemctl status docker //查看docker服务状态
#################################################################################
[root@localhost ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: http://docs.docker.com
[root@localhost ~]# 
[root@localhost ~]# systemctl start docker
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since 三 2017-08-30 21:41:53 CST; 2s ago
     Docs: http://docs.docker.com
 Main PID: 14325 (dockerd-current)
   CGroup: /system.slice/docker.service
           ├─14325 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupd...
           └─14328 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --shim docker-containerd-shim --metrics-interval...


8月 30 21:41:52 localhost.localdomain dockerd-current[14325]: time="2017-08-30T21:41:52.458046787+08:00" level=info msg="Graph migration to content-addressa...seconds"
8月 30 21:41:52 localhost.localdomain dockerd-current[14325]: time="2017-08-30T21:41:52.460314367+08:00" level=warning msg="mountpoint for pids not found"
8月 30 21:41:52 localhost.localdomain dockerd-current[14325]: time="2017-08-30T21:41:52.461302410+08:00" level=info msg="Loading containers: start."
8月 30 21:41:52 localhost.localdomain dockerd-current[14325]: time="2017-08-30T21:41:52.527311664+08:00" level=info msg="Firewalld running: true"
8月 30 21:41:53 localhost.localdomain dockerd-current[14325]: time="2017-08-30T21:41:53.229185492+08:00" level=info msg="Default bridge (docker0) is assigne...address"
8月 30 21:41:53 localhost.localdomain dockerd-current[14325]: time="2017-08-30T21:41:53.621786297+08:00" level=info msg="Loading containers: done."
8月 30 21:41:53 localhost.localdomain dockerd-current[14325]: time="2017-08-30T21:41:53.622579251+08:00" level=info msg="Daemon has completed initialization"
8月 30 21:41:53 localhost.localdomain dockerd-current[14325]: time="2017-08-30T21:41:53.622639293+08:00" level=info msg="Docker daemon" commit="88a4867/1.12...n=1.12.6
8月 30 21:41:53 localhost.localdomain systemd[1]: Started Docker Application Container Engine.
8月 30 21:41:53 localhost.localdomain dockerd-current[14325]: time="2017-08-30T21:41:53.661771834+08:00" level=info msg="API listen on /var/run/docker.sock"
Hint: Some lines were ellipsized, use -l to show in full.






docker pull kalilinux/kali-linux-docker //在docker仓库拉取kali镜像
#################################################################################
[root@localhost ~]# docker pull kalilinux/kali-linux-docker 
Using default tag: latest
Trying to pull repository docker.io/kalilinux/kali-linux-docker ... 
latest: Pulling from docker.io/kalilinux/kali-linux-docker


b2860afd831e: Pull complete
340395ad18db: Pull complete 
d4ecedcfaa73: Pull complete 
3f96326089c0: Pull complete
e5b4b7133863: Pull complete 
45f74187929d: Pull complete 
6e61dde25369: Pull complete 
96dd93da002c: Pull complete 
dae364b40b0d: Pull complete 
c680ef1373da: Pull complete 
261c33ef5c83: Pull complete 
cb8b228855a6: Pull complete 
c8f41032911e: Pull complete 
Digest: sha256:2ebc75f51fa4937340a0d3b4fe903c60aad23866b8c9e1fae80ad7372e01b71d




//查看镜像id
[root@localhost ~]# docker images
REPOSITORY                              TAG                 IMAGE ID            CREATED             SIZE
docker.io/kalilinux/kali-linux-docker   latest              8ececeaf404d        6 months ago        1.558 GB


docker run -i -t 8ececeaf404d /bin/bash //启动容器并登录到操作系统
#################################################################################
[root@localhost ~]# docker run -i -t 8ececeaf404d /bin/bash
root@0f7eff653602:/# 
root@0f7eff653602:/# 


[root@localhost ~]# docker ps //查看容器已为启动状态
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
0f7eff653602        8ececeaf404d        "/bin/bash"         49 seconds ago      Up 44 seconds                           gigantic_torvalds
[root@localhost ~]# 
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值