
This is preferred so that you don’t waste storage on a bunch of stopped containers. The –rm switch makes Docker delete the container once you exit the shell.
This will create (or re-use them if they’re already created) two volumes named kali-root and kali-postgres and map them to the created container. To start a new Kali Docker container using the image we just created, you’ll want to use this command:ĭocker run -ti -rm -mount src=kali-root,dst=/root -mount src=kali-postgres,dst=/var/lib/postgresql my-kali You’ll probably want to save the data in the /root and /var/lib/postgresql directories so that you can save any data in those directories if your container is deleted. Now we’ll want to run to create a Docker imaged names my-kali (change it to what you want):ĭepending on what you installed, this step could take a while. To get a list of all your Docker containers, run this command:Ĭopy the CONTAINER ID, which will look similar to this: 0dd01659d8dd Once you get your updates and packages installed, you’ll want to create a local Docker image. Let’s get started by installing these common Metapackages:Īpt install exploitdb Create Local Docker Image After Updates Install Kali keeps a list of common Metapackages here. Since the image we used above is bare bones, you’ll want to install some Kali Metapackages to get the tools you need. You’ll want to run the following commands to update the Kali packages: Run the following commands to pull the most recent Kali Linux Docker Image, create the Docker Container and start /bin/bash in that container:ĭocker run -ti kalilinux/kali-linux-docker /bin/bash Update Kali LinuxĪfter running the commands above, you’ll be at the /bin/bash prompt. This article assumes you already have Docker installed and running. Offensive Security has created a kalilinux/kali-linux-docker bare bones image, which is what we’ll use to get started. You can still run it on Windows, but it will use more overhead than Linux and macOS. If you’re running Docker on Linux or macOS, it requires less resources than a full blown virtual machine. Most of the popular Kali Linux pentest tools are command-line based and don’t require a GUI, which makes Docker an excellent alternative.
Docker is a great alternative to virtualization, especially in the case of Linux if you don’t need a GUI.