feat: Added lab containers and improved pipeline to ensure base containers are built first
Some checks failed
Build and Push Dev Containers / build (push) Failing after 2m12s

This commit is contained in:
2025-10-21 22:26:09 +01:00
parent 153ad3c0c4
commit 2bab7322ec
6 changed files with 47 additions and 7 deletions

View File

@@ -24,8 +24,32 @@ jobs:
- name: Build and push containers - name: Build and push containers
run: | run: |
for dir in $(find . -type f -iname 'Dockerfile' -exec dirname {} \; | sed 's|^\./||'); do # ...existing code...
tag="${{ secrets.CONTAINER_REGISTRY }}/${{ secrets.CONTAINER_REGISTRY_USERNAME }}/$dir:latest" set -euo pipefail
registry="${{ secrets.CONTAINER_REGISTRY }}"
username="${{ secrets.CONTAINER_REGISTRY_USERNAME }}"
# Build 'base' and 'lab' groups first (including subdirectories)
for group in base lab; do
if [ -d "$group" ]; then
echo "Processing group: $group"
find "$group" -type f -iname 'Dockerfile' -exec dirname {} \; | sed 's|^\./||' | sort -u | while read -r dir; do
tag="$registry/$username/$dir:latest"
echo "Building $dir -> $tag"
docker build -t "$tag" "$dir"
docker push "$tag"
done
else
echo "Skipping missing group: $group"
fi
done
# Then build everything else (exclude base and lab)
echo "Processing remaining Dockerfiles"
find . -type f -iname 'Dockerfile' -exec dirname {} \; | sed 's|^\./||' | sort -u | grep -Ev '^(base|lab)(/|$)' | while read -r dir; do
tag="$registry/$username/$dir:latest"
echo "Building $dir -> $tag"
docker build -t "$tag" "$dir" docker build -t "$tag" "$dir"
docker push "$tag" docker push "$tag"
done done

4
go-dev/Dockerfile Normal file
View File

@@ -0,0 +1,4 @@
FROM git.luke-else.co.uk/luke-else/lab:latest
RUN apk add --no-cache \
go

View File

@@ -12,12 +12,7 @@ RUN apk add --no-cache \
busybox-extras \ busybox-extras \
net-tools \ net-tools \
iputils \ iputils \
python3 \
procps \ procps \
cargo \
nodejs \
pnpm \
rust-analyzer \
make \ make \
build-base build-base

5
nodejs-dev/Dockerfile Normal file
View File

@@ -0,0 +1,5 @@
FROM git.luke-else.co.uk/luke-else/lab:latest
RUN apk add --no-cache \
nodejs \
pnpm

7
python-dev/Dockerfile Normal file
View File

@@ -0,0 +1,7 @@
FROM git.luke-else.co.uk/luke-else/lab:latest
RUN apk add --no-cache \
python3 \
py3-uv
CMD [ "uv run" ]

5
rust-dev/Dockerfile Normal file
View File

@@ -0,0 +1,5 @@
FROM git.luke-else.co.uk/luke-else/lab:latest
RUN apk add --no-cache cargo rust-analyzer
CMD [ "cargo run --release" ]