Open half2me opened 1 year ago
This problem happens because MacOS has a very old version of bash by default which is missing some more "modern" features like arrays. Currently the default version is "3.2.57", where as iirc arrays was added to bash in >= 4.x.
PATH
variable before the /bin
folder. Though you can see information online for further instructions if you run into problems installing itReplace the shebang in the build-docker.sh
script to the following:
#!/usr/bin/env bash
set -eu
Though you might run into some follow up problems (I'm currently doing the same thing and try to debug as I go).
Update
I was able to build the images with the above tweak to the build-docker.sh
script on my MacOS M1, though you need to checkout the arm64
branch! This is mentioned in the troubleshooting section of the docs, but I overlooked it at the beginning. Below shows how to clone the project's arm64 branch (taken from the README.md)
git clone --branch arm64 https://github.com/RPI-Distro/pi-gen.git
FYI: I've created a PR to the arm64
branch with a change to the build-docker.sh
script to support running on MacOS with the default version of bash (e.g. version 3.x).
Steps to reproduce:
I get the following error:
./build-docker.sh: line 147: DOCKER_CMDLINE_PRE[@]: unbound variable
Output of
docker --version