Kali一键安装docker脚本

2017-10-29 / 0 评论 Kali&Linux / Mrxn

本文共计 1690 字,感谢您的耐心浏览与评论.

Kali不介绍,docker简单的介绍一下:如何通俗解释docker是什么 我的理解用一句话来说就是:在你的系统里面装一个盒子,盒子里你可以干任何事!另外,在gitbook上也有专门的专题介绍,想详细的了解的可以去看一下:

https://yeasy.gitbooks.io/docker_practice/content/

本文主要介绍在Kali下如何一键安装,给懒人看的-_- .

Kali是属于Debian的一个分支基于Debian Wheezy 因此安装方法借助docker官方的Debian安装文档,但是官方的安装方法在Kali上会失败...

所以呢,我就自己Google啊,找到了好几个版本,我结合自己的实际操作和理解,搞了一个综合性的脚本.

下面就是脚本的全部代码:

#!/bin/bash

#=================================================
# Description: Install docker for Kali
# Version: 0.0.1
# Author: Mrxn
# Blog: https://mrxn.net/Linux/install_docker_script_for_Kali.html
# PS: 欢迎大家到github提建议和bug
#=================================================


# install dependencies
sudo apt-get install apt-transport-https ca-certificates curl gnupg software-properties-common dirmngr

# use https get sources
sudo echo "deb https://http.kali.org/kali kali-rolling main non-free contrib" > /etc/apt/sources.list
sudo echo "deb-src https://http.kali.org/kali kali-rolling main non-free contrib" >> /etc/apt/sources.list


# update apt-get
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update

# remove previously installed Docker
sudo apt-get purge lxc-docker*
sudo apt-get purge docker.io*


# add Docker repo gpg key
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

# add deb docker sources
sudo echo "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable" >> /etc/apt/sources.list

cat > /etc/apt/sources.list.d/docker.list <<'EOF'
deb https://apt.dockerproject.org/repo debian-stretch main
EOF
sudo apt-get update

# install Docker
sudo apt-get install docker-ce

# run Hellow World image
sudo docker run hello-world

# manage Docker as a non-root user
sudo groupadd docker
sudo usermod -aG docker $USER

# configure Docker to start on boot
sudo systemctl enable docker                                                         

有啥bug 就去github提吧... https://github.com/Mr-xn/Kali-install-docker       

标签: Kali Linux docker

转载:转载请注明原文链接 - Kali一键安装docker脚本


0条回应:“Kali一键安装docker脚本”


发表评论

{view_code_no}