A cleaned-up version from my Running Kali under Docker with X11 Forwarding on Mac OS X article.
While Homebrew contains a lot of the packages I use for security testing, I wanted to see if I could replace OffSec's Kali VM for PWK with my own linux distribution running in Docker under my macbook.
- .env: The environment file that contains values used by our other files.
- Dockerfile: This file defines the image which includes all of the dependencies and initial configuration we want included in our base image.
- docker-compose.yml: This file performs a build of the image and creates a running container.
- Makefile: Because I'm lazy, I just want to type
make
and have it start and configure XQuartz (for x11 forwarding) and start my container and put me directly into a shell.
- Install and configure XQuartz on mac OS.
- Install and configure Docker Desktop on mac OS.
- Edit the
.env
file. - Copy any files/directories into the
data
directory that you want brought into your home folder. docker-compose up -d
make
If you make subsequent changes to the Dockerfile
, we can issue docker-compose up -d --build
so that it makes use of the other cached layers, rather than doing a full rebuild with --no-cache
.