From 6d169c94277428df842db70f9b3837aaeeef55b7 Mon Sep 17 00:00:00 2001
From: Martin Weise <martin.weise@tuwien.ac.at>
Date: Tue, 15 Apr 2025 08:24:21 +0200
Subject: [PATCH] WIP

Signed-off-by: Martin Weise <martin.weise@tuwien.ac.at>
---
 .gitlab-ci.yml                        | 14 +++++++-------
 dbrepo-analyse-service/Dockerfile     |  2 +-
 dbrepo-dashboard-service/Dockerfile   |  2 +-
 dbrepo-data-service/Dockerfile        |  6 +++---
 dbrepo-metadata-service/Dockerfile    |  6 +++---
 dbrepo-search-service/Dockerfile      |  2 +-
 dbrepo-search-service/init.Dockerfile |  2 +-
 dbrepo-ui/Dockerfile                  |  4 ++--
 lib/java/dbrepo-core/Dockerfile       |  2 +-
 9 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4b0607c2ce..2d5f3a4282 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -15,6 +15,7 @@ variables:
   APP_VERSION: "1.8.1"
   CHART_VERSION: "1.8.1"
   SUPPORTED_VERSIONS: "1.7.3, 1.8.0, 1.8.1"
+  SUPPORTED_ARCH: "linux/amd64,linux/arm64"
   MAINTAINED_SERVICES: "analyse-service, auth-service-init, dashboard-service, dashboard-service-init, data-service, metadata-service, search-db, search-service, search-service-init, storage-service-init, ui"
   CACHE_FALLBACK_KEY: "${CI_DEFAULT_BRANCH}"
   # This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
@@ -522,7 +523,8 @@ release-images:
   stage: release
   image: docker:${DOCKER_VERSION}-dind
   variables:
-    BUILDX_ARGS: --load --quiet
+    BUILD_ARGS: --network=host
+    COMPOSE_BUILD_ARGS: -q --parallel
   dependencies:
     - clean-images
     - test-analyse-service
@@ -540,13 +542,11 @@ release-images:
     - "echo ${CI_REGISTRY_PASSWORD} | docker login --username ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY_URL}"
     - "docker logout ${CI_REGISTRY2_URL}"
     - "echo ${CI_REGISTRY2_PASSWORD} | docker login --username ${CI_REGISTRY2_USER} --password-stdin ${CI_REGISTRY2_URL}"
-    - "docker buildx create --name multiarch --driver docker-container --use"
   script:
-    - docker buildx build --platform linux/amd64 $BUILDX_ARGS -t dbrepo-core:build --target build ./lib/java/dbrepo-core
-    - docker buildx build --platform linux/arm64 $BUILDX_ARGS -t dbrepo-core:build --target build ./lib/java/dbrepo-core
-    - docker buildx build $BUILDX_ARGS -t dbrepo-data-service:build --target build dbrepo-data-service
-    - docker buildx build $BUILDX_ARGS -t dbrepo-metadata-service:build --target build dbrepo-metadata-service
-    - docker compose build -q --parallel
+    - docker build $BUILD_ARGS -t dbrepo-core:build --target build ./lib/java/dbrepo-core
+    - docker build $BUILD_ARGS -t dbrepo-data-service:build --target build ./dbrepo-data-service
+    - docker build $BUILD_ARGS -t dbrepo-metadata-service:build --target build ./dbrepo-metadata-service
+    - docker compose build $COMPOSE_BUILD_ARGS
     - docker tag dbrepo-analyse-service:latest "${CI_REGISTRY2_URL}/analyse-service:${APP_VERSION}${BUILD_VERSION}"
     - docker tag dbrepo-auth-service-init:latest "${CI_REGISTRY2_URL}/auth-service-init:${APP_VERSION}${BUILD_VERSION}"
     - docker tag dbrepo-dashboard-service:latest "${CI_REGISTRY2_URL}/dashboard-service:${APP_VERSION}${BUILD_VERSION}"
diff --git a/dbrepo-analyse-service/Dockerfile b/dbrepo-analyse-service/Dockerfile
index df313ec934..26ea3ce65c 100644
--- a/dbrepo-analyse-service/Dockerfile
+++ b/dbrepo-analyse-service/Dockerfile
@@ -1,4 +1,4 @@
-FROM --platform=$BUILDPLATFORM python:3.11-alpine3.21
+FROM python:3.11-alpine3.21
 LABEL org.opencontainers.image.authors="martin.weise@tuwien.ac.at"
 
 RUN apk --no-cache add \
diff --git a/dbrepo-dashboard-service/Dockerfile b/dbrepo-dashboard-service/Dockerfile
index 62caad802f..e739245d30 100644
--- a/dbrepo-dashboard-service/Dockerfile
+++ b/dbrepo-dashboard-service/Dockerfile
@@ -1,4 +1,4 @@
-FROM --platform=$BUILDPLATFORM python:3.11-alpine3.21
+FROM python:3.11-alpine3.21
 LABEL org.opencontainers.image.authors="martin.weise@tuwien.ac.at"
 
 RUN apk add --no-cache \
diff --git a/dbrepo-data-service/Dockerfile b/dbrepo-data-service/Dockerfile
index 769014f61b..7468f1c568 100644
--- a/dbrepo-data-service/Dockerfile
+++ b/dbrepo-data-service/Dockerfile
@@ -1,9 +1,9 @@
 ###### FIRST STAGE ######
-FROM --platform=$BUILDPLATFORM dbrepo-core:build AS dependency
+FROM dbrepo-core:build AS dependency
 LABEL org.opencontainers.image.authors="martin.weise@tuwien.ac.at"
 
 ###### SECOND STAGE ######
-FROM --platform=$BUILDPLATFORM maven:3-amazoncorretto-17 AS build
+FROM maven:3-amazoncorretto-17 AS build
 LABEL org.opencontainers.image.authors="martin.weise@tuwien.ac.at"
 
 COPY ./pom.xml ./
@@ -21,7 +21,7 @@ COPY ./services ./services
 RUN mvn -fn clean package -DskipTests
 
 ###### THIRD STAGE ######
-FROM --platform=$BUILDPLATFORM amazoncorretto:17-alpine3.19 AS runtime
+FROM amazoncorretto:17-alpine3.19 AS runtime
 LABEL org.opencontainers.image.authors="martin.weise@tuwien.ac.at"
 
 RUN apk add --no-cache curl bash jq
diff --git a/dbrepo-metadata-service/Dockerfile b/dbrepo-metadata-service/Dockerfile
index f034640e6a..8d01865d85 100644
--- a/dbrepo-metadata-service/Dockerfile
+++ b/dbrepo-metadata-service/Dockerfile
@@ -1,9 +1,9 @@
 ###### FIRST STAGE ######
-FROM --platform=$BUILDPLATFORM dbrepo-core:build AS dependency
+FROM dbrepo-core:build AS dependency
 LABEL org.opencontainers.image.authors="martin.weise@tuwien.ac.at"
 
 ###### SECOND STAGE ######
-FROM --platform=$BUILDPLATFORM maven:3-amazoncorretto-17 AS build
+FROM maven:3-amazoncorretto-17 AS build
 LABEL org.opencontainers.image.authors="martin.weise@tuwien.ac.at"
 
 COPY ./pom.xml ./
@@ -22,7 +22,7 @@ COPY ./services ./services
 RUN mvn -fn clean package -DskipTests
 
 ###### THIRD STAGE ######
-FROM --platform=$BUILDPLATFORM amazoncorretto:17-alpine3.19 AS runtime
+FROM amazoncorretto:17-alpine3.19 AS runtime
 LABEL org.opencontainers.image.authors="martin.weise@tuwien.ac.at"
 
 RUN apk add --no-cache curl bash jq
diff --git a/dbrepo-search-service/Dockerfile b/dbrepo-search-service/Dockerfile
index 1d0862a9e5..0366024576 100644
--- a/dbrepo-search-service/Dockerfile
+++ b/dbrepo-search-service/Dockerfile
@@ -1,4 +1,4 @@
-FROM --platform=$BUILDPLATFORM python:3.11-alpine3.21
+FROM python:3.11-alpine3.21
 LABEL org.opencontainers.image.authors="martin.weise@tuwien.ac.at"
 
 RUN apk add --no-cache \
diff --git a/dbrepo-search-service/init.Dockerfile b/dbrepo-search-service/init.Dockerfile
index 2099df48cc..cf4cb94d85 100644
--- a/dbrepo-search-service/init.Dockerfile
+++ b/dbrepo-search-service/init.Dockerfile
@@ -1,4 +1,4 @@
-FROM --platform=$BUILDPLATFORM python:3.11-alpine3.21
+FROM python:3.11-alpine3.21
 LABEL org.opencontainers.image.authors="martin.weise@tuwien.ac.at"
 
 RUN apk add --no-cache \
diff --git a/dbrepo-ui/Dockerfile b/dbrepo-ui/Dockerfile
index 966b7dbb3d..53928c4998 100644
--- a/dbrepo-ui/Dockerfile
+++ b/dbrepo-ui/Dockerfile
@@ -1,5 +1,5 @@
 ###### FIRST STAGE ######
-FROM --platform=$BUILDPLATFORM oven/bun:1.1.40-alpine AS build
+FROM oven/bun:1.1.40-alpine AS build
 
 WORKDIR /app
 
@@ -27,7 +27,7 @@ COPY ./nuxt.config.ts ./nuxt.config.ts
 RUN bun run build
 
 ###### SECOND STAGE ######
-FROM --platform=$BUILDPLATFORM node:22.9.0-alpine3.20 AS runtime
+FROM node:22.9.0-alpine3.20 AS runtime
 
 ARG APP_VERSION="latest"
 ARG COMMIT=""
diff --git a/lib/java/dbrepo-core/Dockerfile b/lib/java/dbrepo-core/Dockerfile
index 8a6348bbce..5ffecc14d4 100644
--- a/lib/java/dbrepo-core/Dockerfile
+++ b/lib/java/dbrepo-core/Dockerfile
@@ -1,5 +1,5 @@
 ###### FIRST STAGE ######
-FROM maven:3-amazoncorretto-17 AS build
+FROM --platform=$BUILDPLATFORM maven:3-amazoncorretto-17 AS build
 LABEL org.opencontainers.image.authors="martin.weise@tuwien.ac.at"
 
 COPY ./pom.xml ./
-- 
GitLab