diff --git a/stage2.1_custom/00-install/00-run.sh b/stage2.1_custom/00-install/00-run.sh index bb25af5..f7e9cdc 100755 --- a/stage2.1_custom/00-install/00-run.sh +++ b/stage2.1_custom/00-install/00-run.sh @@ -1,18 +1,29 @@ #!/bin/bash set -e -# Install Docker (official instructions for Raspberry Pi OS) -curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg +# do some checks first +echo "DEBUG: Listing /home" +ls -l /home +echo "DEBUG: Checking for python3" +which python3 || echo "python3 not found" +echo "DEBUG: Checking user 'caster'" +id caster || echo "user caster not found" -apt-get update && apt-get install -y lsb-release -echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \ - $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null +# Add Docker's official GPG key: apt-get update -apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin +apt-get install -y ca-certificates curl +install -m 0755 -d /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc +chmod a+r /etc/apt/keyrings/docker.asc -systemctl enable docker || true +# Add the repository to Apt sources: +echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ + bookworm stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null +apt-get update +apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin # Ensure docker group exists and add main user to it DOCKER_GROUP=docker @@ -23,7 +34,7 @@ fi USER_TO_ADD="${FIRST_USER_NAME:-pi}" usermod -aG "$DOCKER_GROUP" "$USER_TO_ADD" || true -docker compose version || true +docker compose version # Install Python Poetry (official installer) curl -sSL https://install.python-poetry.org | python3 - diff --git a/stage2.1_custom/prerun.sh b/stage2.1_custom/prerun.sh new file mode 100755 index 0000000..9acd13c --- /dev/null +++ b/stage2.1_custom/prerun.sh @@ -0,0 +1,5 @@ +#!/bin/bash -e + +if [ ! -d "${ROOTFS_DIR}" ]; then + copy_previous +fi