Dateien für docker image build & push angelegt

This commit is contained in:
2026-04-23 10:37:52 +02:00
parent b159bdd351
commit 838f6e96e0
5 changed files with 66 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
{ {
"java.configuration.updateBuildConfiguration": "disabled" "java.configuration.updateBuildConfiguration": "disabled",
"java.compile.nullAnalysis.mode": "disabled"
} }

View File

@@ -0,0 +1,17 @@
# ---------------------------------------------------------------------------
# Build-Stage: Maven-Build
# ---------------------------------------------------------------------------
FROM eclipse-temurin:25-jdk AS builder
WORKDIR /build
COPY . .
RUN ./mvnw package -DskipTests --no-transfer-progress
# ---------------------------------------------------------------------------
# Runtime-Stage: Minimales JRE-Image
# ---------------------------------------------------------------------------
FROM eclipse-temurin:25-jre
WORKDIR /app
COPY --from=builder /build/target/quarkus-app/ ./
EXPOSE 8080
USER 1000
ENTRYPOINT ["java", "-jar", "quarkus-run.jar"]

View File

@@ -0,0 +1,10 @@
# ---------------------------------------------------------------------------
# Build- und Deploy-Konfiguration (keine Secrets — kann committet werden)
# ---------------------------------------------------------------------------
REGISTRY=ocir.eu-frankfurt-1.oci.oraclecloud.com/frhqaxi5sgcg
IMAGE_NAME=container/automaton
IMAGE_TAG=1.0.0
REGISTRY_USER=frhqaxi5sgcg/<your username> # frhqaxi5sgcg is the tenancy ID
REGISTRY_PW=<your users auth token>

View File

@@ -0,0 +1,17 @@
# Docker build (for arm nodes using qemu)
- Install docker CLI https://daniel.es/blog/how-to-install-docker-in-wsl-without-docker-desktop/
- For reference: Guide for setting up multiarch build support: https://docs.docker.com/build/building/multi-platform/
- Configure qemu emulation for arm on x86_64:
- docker buildx create --name multi-arch-builder --use
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- docker buildx inspect --bootstrap
- Before building and pushing: Copy the .env-example file to .env and enter auth info inside it
- run ./build.sh (executes docker buildx build command to build an image on a x86 host that can run on an arm node, e.g.:
docker buildx build --platform linux/arm64 --load -t $IMAGE . --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy --build-arg no_proxy=$no_proxy)
Multiarch images cannot be loaded into the deamon using --load but need to be pushed into a registry directly using --push or be exported to a file
# Docker push image to OCI
- run .

View File

@@ -0,0 +1,20 @@
#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
source "${SCRIPT_DIR}/.env"
IMAGE="${REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}"
echo "=== Image bauen & pushen: ${IMAGE} ==="
docker login -u $REGISTRY_USER -p $REGISTRY_PW https://$REGISTRY
docker buildx build \
--platform linux/arm64,linux/amd64 \
--push \
-t $IMAGE \
"${SCRIPT_DIR}/.."
# in case you use a proxy:
#--build-arg http_proxy=$http_proxy \
#--build-arg https_proxy=$https_proxy \
#--build-arg no_proxy=$no_proxy \
echo "Fertig: ${IMAGE}"