How to Install Kali Docker Image to the Linux ? - GeeksforGeeks

29 Jun, 2021
In the cybersecurity sector, Kali is a prominent security distribution. Penetration testers, in particular, adore it. Kali has a number of security exploitation tools that may be used to test various systems, such as servers, networks, application servers, databases, VoIP, and so on. Kali is available in a variety of formats, including a virtual machine, an ISO file, a USB image, and a container.
To install docker,  run the following command:
$ sudo apt-get install docker.io
Installing Docker
Docker is a daemon service that runs in the background. This service must be started before we can use Docker. There are a variety of service and daemon management tools available, but they all support sytemctl.
$ sudo systemctl start docker
Starting Docker
The status option can be used to examine the status of a Docker service.
$ sudo systemctl status docker
Checking docker service status
We can now use the docker command to locate the Kali Docker image. To identify accessible Kali container images in the Docker Hub, we’ll use the search subcommand with the kali keyword.
$ sudo docker search kali
Searching kali image
Now choose the most popular one, which is offered by kali developers.
We’ll use the pull subcommand to get a Kali container image from the Docker Repository, as seen below. Container pictures are downloaded in many parts and employ a layered file structure. This has the advantage of allowing you to make several containers from a single image because just the altered parts of the image will be copied, while the rest of the image will be used by numerous containers without issue.
$ sudo docker pull kalilinux/kali-rolling
Installing container image
Now choose the most popular one, which is offered by kali developers.
The run subcommand will be used to start the container. However, there are a few options that we should present. How can we connect to Kali after the container has started? We’ll use the -t and -i options to indicate that we’d like to connect to the terminal interactively.
$ sudo docker run -t -i kalilinux/kali-rolling
Running the container
We should update the Kali container’s package metadata because it contains outdated utilities. Another reason is that apt does not have up-to-date and complete package information. The following command will be used to update package information.
$ apt-get update
Updating packages
The Kali container comes with relatively few tools by default. Using apt package management, we should install the essential tools. In the following example, we will install nmap.
$ apt install nmap -y
Installing nmap
Dockers are the most efficient way to distribute and deploy your packages. The Kali Linux docker image is quite useful; it doesn’t take up a lot of disc space, and it’s now very simple to test this amazing distro on any docker-enabled operating system.
Kali-Linux
Picked
Linux-Unix
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
scp command in Linux with Examples
Docker - COPY Instruction
mv command in Linux with examples
SED command in Linux | Set 2
chown command in Linux with Examples
nohup Command in Linux with Examples
Named Pipe or FIFO with example C program
Thread functions in C/C++
uniq Command in LINUX with examples
Start/Stop/Restart Services Using Systemctl in Linux