Update Docker installation and add prerun script for stage2.1_custom
This commit is contained in:
@@ -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 -
|
||||
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
if [ ! -d "${ROOTFS_DIR}" ]; then
|
||||
copy_previous
|
||||
fi
|
||||
Reference in New Issue
Block a user