diff --git a/README.md b/README.md index b4558f1..388fcbb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ # Terraform Docker Packer -This Terraform module serves as an abstraction to builds machine images from Packer configurations through Docker. +This Terraform module serves as an abstraction to builds machine images from Packer configurations through Docker. +A pre-existing Docker image with Packer installed is required. +The build runs in the background and outpout the image to the local directory. +To see the build progress, you need to show the Docker logs like this: +``` +docker logs -f $(docker ps -q -f name=packer-builder-arm) +``` ## Requirements diff --git a/examples/raspios/README.md b/examples/raspios/README.md index adc571b..f529a9e 100644 --- a/examples/raspios/README.md +++ b/examples/raspios/README.md @@ -1,10 +1,21 @@ # RaspiOS -Build a new ARM64 device image based on RaspiOS. -The Packer config will run some scripts through the Shell provisioner in order to setup and configure the device image. +Build a ARM64 device image based on RaspiOS. +The Packer config will run some scripts located at `./scripts` through the Shell provisioner in order to setup and configure the device image. In addition, `Firstboot` will be configured to run an additional setup scripts during first boot of the device. +## Provisioning + +``` +# run the Packer build +terraform init +terraform apply + +# show build progress +docker logs -f $(docker ps -q -f name=packer-builder-arm) +``` + ## Firstboot -This example contains a Systemd service and script that will run at first boot and sets the hostname to `rpi-SERIAL`. +This example contains a Systemd service and script that will run at first boot and sets the hostname to `rpi-SERIAL` so that each device gets a unique hostname. Adopted from https://github.com/nmcclain/raspberian-firstboot \ No newline at end of file diff --git a/examples/raspios/main.tf b/examples/raspios/main.tf index 7fef991..e2e5355 100644 --- a/examples/raspios/main.tf +++ b/examples/raspios/main.tf @@ -3,7 +3,7 @@ module "raspios" { packer_config = "packer/raspios.pkr.hcl" packer_variables = { image_path = "rpi-arm64.img" - scripts = [ + scripts = [ "scripts/pi.sh", "scripts/docker.sh", "scripts/hashi.sh"