We want our box to run smoothly, so it should only have what we need for our softwaret to work. To do that, we can build a docker image from a lightweight linux distro.
- TODO: refine the dockerfile
- TODO: build our local code into the docker container via dockerfile
tutorial: here
note: to alter makefile config, check out the Makefile intro
- while in this directory in your favorite IDE, run
docker build --tag pwnable:0.1 .
- once the image is built, run it with
docker run -it pwnable:0.1
-i
runs it in interactive mode, so you can directly access the shell
- inside the container, navigate to
/buildroot
- to configure buildroot to configure building for raspberry pi 4 (ARM), run
make raspberrypi4_defconfig
- can optionally run
make menuconfig
to access an interactive configuration program to edit this if we need to
- can optionally run
- tell buildroot to compile and generate our
.img
file- it should output to
/buildroot/output/images/sdcard.img
- it should output to
- exit out of the container instance with
CTRL/CMD-d
- copy the
.img
file from the docker container into our local working directory withdocker cp {container-id}:/buildroot/output/images/sdcard.img .
- we can now load this into Raspberry Pi Imager and write our image to an SD card
- insert the SD card into the Pi, and start it up :)