diff --git a/Dockerfile b/Dockerfile index 53a9fbc..b136dc4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ -FROM archlinux:base-devel +#################### +## Base container ## +#################### +FROM archlinux:base-devel AS base LABEL org.opencontainers.image.title="actions-docker" LABEL org.opencontainers.image.description="StarOpenSource's Docker image for CI/CD pipelines." @@ -23,3 +26,11 @@ RUN pacman -Syu --noconfirm # Install packages required for actions to function properly RUN pacman -S --noconfirm nodejs git + +#################### +## Java container ## +#################### +FROM base AS java + +# Install OpenJDK 21 +RUN pacman -S --noconfirm jdk21-openjdk diff --git a/Dockerfile.java b/Dockerfile.java deleted file mode 100644 index 95e0271..0000000 --- a/Dockerfile.java +++ /dev/null @@ -1,4 +0,0 @@ -FROM git.staropensource.de/staropensource/actions-docker:latest - -# Install latest OpenJDK release -RUN pacman -S --noconfirm jdk-openjdk diff --git a/Makefile b/Makefile index c1f1760..2d0a8e0 100644 --- a/Makefile +++ b/Makefile @@ -7,12 +7,12 @@ help: @echo " prune-cache Prunes the entire build cache" build: docker buildx rm actions-docker || true - docker buildx create --name actions-docker --bootstrap --use - docker buildx build --load --platform ${PLATFORMS} -t git.staropensource.de/staropensource/actions-docker:latest -f Dockerfile . - docker buildx build --load --platform ${PLATFORMS} -t git.staropensource.de/staropensource/actions-docker:java -f Dockerfile.java . + docker buildx create --bootstrap --name actions-docker --platform ${PLATFORMS} + docker buildx build --builder actions-docker --load --platform ${PLATFORMS} --target base -t git.staropensource.de/infrastructure/actions-docker:latest . + docker buildx build --builder actions-docker --load --platform ${PLATFORMS} --target java -t git.staropensource.de/infrastructure/actions-docker:java . docker buildx rm actions-docker upload: build - docker push git.staropensource.de/staropensource/actions-docker:latest - docker push git.staropensource.de/staropensource/actions-docker:java + docker push git.staropensource.de/infrastructure/actions-docker:latest + docker push git.staropensource.de/infrastructure/actions-docker:java prune-cache: docker buildx prune -af