After installing Docker, add your user to the Docker group to run Docker commands without sudo.
Add User to Docker Group:
sudo usermod -aG docker $USER
Refresh Group Membership:
newgrp docker
Verify Group Membership:
groups $USER
docker ps
This command lists running containers. We have nothing running as it's a new environment
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
docker run hello-world
The docker run hello-world command is a simple way to verify that Docker is installed and functioning correctly on your system.
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(arm64v8)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
start minikube
Minikube is an open-source tool that enables you to run a single-node Kubernetes cluster locally on your machine. Minikube runs a Kubernetes cluster in a virtual machine (VM) on your computer, which allows developers to create and manage Kubernetes environments without needing a full-blown, multi-node cluster.
┌──(sx0tt㉿kali-linux)-[~/kube-test]
└─$ minikube start
😄 minikube v1.33.1 on Debian kali-rolling (arm64)
✨ Using the docker driver based on existing profile
👍 Starting "minikube" primary control-plane node in "minikube" cluster
🚜 Pulling base image v0.0.44 ...
🏃 Updating the running docker "minikube" container ...
🐳 Preparing Kubernetes v1.30.0 on Docker 26.1.1 ...
🔎 Verifying Kubernetes components...
▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟 Enabled addons: storage-provisioner, default-storageclass
❗ /usr/bin/kubectl is version 1.20.2, which may have incompatibilities with Kubernetes 1.30.0.
▪ Want kubectl v1.30.0? Try 'minikube kubectl -- get pods -A'
🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
get nodes
┌──(sx0tt㉿kali-linux)-[~/kube-test]
└─$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
minikube Ready control-plane 25m v1.30.0
Lets create a deployment file and service file for nginx
Deployment: A Deployment ensures that a specified number of identical Pods (boxes) are always running, updating them when needed.
Service: A Service provides a stable network address for accessing the Pods (boxes) and balances the load among them, even if the underlying Pods change.
┌──(sx0tt㉿kali-linux)-[~/kube-test]
└─$ kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
nginx-deployment 2/2 2 2 17s
┌──(sx0tt㉿kali-linux)-[~/kube-test]
└─$ kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP **.**.*.* <none> 443/TCP 9m15s
nginx-service LoadBalancer **.***.***.*** <pending> 80:32406/TCP 20s
Now lets get pods
┌──(sx0tt㉿kali-linux)-[~/kube-test]
└─$ kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-deployment-77d8468669-s4t8z 1/1 Running 0 41s
nginx-deployment-77d8468669-tm2lr 1/1 Running 0 41s
Creating a kali dockerfile and pushing to docker hub
Here's what we're going to do to get kali pushed to our repo and then deployed
Create the kali dockerfile
Build the docker image
Push that image to Docker Hub
Deploy image to K8s
Apply the deployment to K8s
Create the docker file
┌──(sx0tt㉿kali-linux)-[~/kube-test]
└─$ vim Dockerfile
# Kali Linux latest with useful tools
FROM kalilinux/kali-rolling
# Set working directory to /root
WORKDIR /root
# Change the repository mirror to a known stable one
RUN sed -i 's/http.kali.org/kali.download/g' /etc/apt/sources.list
# Update and install CA certificates
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y ca-certificates
# Install common and useful tools with retries
RUN apt-get update --fix-missing && apt install -y --no-install-recommends \
curl \
wget \
vim \
git \
net-tools \
whois \
netcat-traditional \
pciutils \
python3-pip \
golang \
npm \
kali-tools-top10 \
exploitdb \
man-db \
dirb \
nikto \
wpscan \
uniscan \
lsof \
apktool \
dex2jar \
&& apt-get clean
# Set the default command to run when starting the container
ENTRYPOINT ["/bin/bash"]
Build the docker image
┌──(sx0tt㉿kali-linux)-[~/kube-test]
└─$ docker build -t sx0tt/kali-linux-tools .
Sending build context to Docker daemon 4.608kB
Step 1/6 : FROM kalilinux/kali-rolling
---> 004a2a193e66
Step 2/6 : WORKDIR /root
---> Using cache
---> 3a22277f9680
Step 3/6 : RUN sed -i 's/http.kali.org/kali.download/g' /etc/apt/sources.list
---> Using cache
---> a948ed5547d9
Step 4/6 : RUN apt-get update && apt-get upgrade -y && apt-get install -y ca-certificates
---> Using cache
---> b7b4262177b9
Step 5/6 : RUN apt-get update --fix-missing && apt install -y --no-install-recommends curl wget vim git net-tools whois netcat-traditional pciutils python3-pip golang npm kali-tools-top10 exploitdb man-db dirb nikto wpscan uniscan lsof apktool dex2jar && apt-get clean
---> Running in 78d365f66f35
<...SNIP...>
Removing intermediate container 78d365f66f35
---> 5b031adcec12
Step 6/6 : ENTRYPOINT ["/bin/bash"]
---> Running in b3fd56581133
Removing intermediate container b3fd56581133
---> eaafa11a4876
Successfully built eaafa11a4876
Successfully tagged sx0tt/kali-linux-tools:latest
make sure to substitute your docker hub username and image name