# Stage 1: Build the project using Gradle wrapper FROM openjdk:21-jdk-slim AS builder WORKDIR /workspace # Copy the entire repository into the build stage COPY . . # Ensure wrapper is executable and can fetch Gradle RUN chmod +x gradlew # Build the project (this uses the Gradle wrapper, downloads dependencies) RUN ./gradlew cleanBuild build collect uploadFiles --no-daemon --stacktrace # Stage 2: Runtime image FROM eclipse-temurin:21-jre WORKDIR /app # Copy built jars from the build stage COPY --from=builder /workspace/build/libs/*.jar /app/ # Expose common Minecraft server port EXPOSE 25565 # Start the server by locating the first jar and running it with nogui CMD ["sh","-lc","JAR=$(ls /app/*.jar 2>/dev/null | head -n 1); if [ -z \"$JAR\" ]; then echo 'No jar found'; exit 1; fi; exec java -jar \"$JAR\" nogui"]
# Stage 1: Build the project using Gradle wrapper FROM eclipse-temurin:21-jdk AS builder WORKDIR /workspace # Copy the entire repository into the build stage COPY . . # Ensure wrapper is executable and can fetch Gradle RUN chmod +x gradlew # Build the project (this uses the Gradle wrapper, downloads dependencies) RUN ./gradlew cleanBuild build collect uploadFiles --no-daemon --stacktrace # Stage 2: Runtime image FROM eclipse-temurin:21-jre WORKDIR /app # Copy built jars from the build stage COPY --from=builder /workspace/build/libs/*.jar /app/ # Expose common Minecraft server port EXPOSE 25565 # Start the server by locating the first jar and running it with nogui CMD ["sh","-lc","JAR=$(ls -1 /app/*.jar 2>/dev/null | head -n 1); if [ -z \"$JAR\" ]; then echo 'No jar found'; exit 1; fi; exec java -jar \"$JAR\" nogui"]
# Ignore VCS and local dev artifacts .git .gradle build out *.class *.jar node_modules .idea *.iml .DS_Store
- Failing command/step: - RUN ./gradlew cleanBuild build collect uploadFiles --no-daemon --stacktrace (builder 5/5) - Exact error message and exit code: - BUILD FAILED - A problem occurred evaluating root project 'arclight'. - > A problem occurred starting process 'command 'git'' - Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'git'' - Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'git' - Caused by: java.io.IOException: Cannot run program "git" (in directory "/workspace"): Exec failed, error: 2 (No such file or directory) - BUILD FAILED3 actionable tasks: 3 executed - Exit code: 1 - Missing packages or files mentioned: - Git binary is missing in the build image (Cannot run program "git"). No such file or directory. - Version mismatch / warnings: - Gradle 8.13 is being used (Downloading https://services.gradle.org/distributions/gradle-8.13-all.zip). - Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. - Brief remediation suggestion: - Install Git in the Docker image (e.g., apt-get update && apt-get install -y git) or ensure Git is available in the build context before running Gradle tasks.
# Stage 1: Build the project using Gradle wrapper
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /workspace
# Install git (Gradle wrapper may fetch dependencies from git-based repos during build)
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the entire repository into the build stage
COPY . .
# Ensure wrapper is executable and can fetch Gradle
RUN chmod +x gradlew
# Build the project (this uses the Gradle wrapper, downloads dependencies)
RUN ./gradlew cleanBuild build collect uploadFiles --no-daemon --stacktrace
# Stage 2: Runtime image
FROM eclipse-temurin:21-jre
WORKDIR /app
# Copy built jars from the build stage (preserve multiple jars in case of a multi-jar output)
COPY --from=builder /workspace/build/libs /app/libs
# Expose common Minecraft server port
EXPOSE 25565
# Start the server by locating the first jar and running it with nogui
CMD ["sh","-lc","JAR=$(ls -1 /app/libs/*.jar 2>/dev/null | head -n 1); if [ -z \"$JAR\" ]; then echo 'No jar found'; exit 1; fi; exec java -jar \"$JAR\" nogui"]
Failing step - Builder stage: builder 6/6 - Command: RUN ./gradlew cleanBuild build collect uploadFiles --no-daemon --stacktrace Exact error messages and exit code - ERROR: process "/bin/sh -c ./gradlew cleanBuild build collect uploadFiles --no-daemon --stacktrace" did not complete successfully: exit code: 1 - BUILD FAILED in 1m 46s - A problem occurred evaluating root project 'arclight'. - > Process 'command 'git'' finished with non-zero exit value 128 - fatal: not a git repository (or any of the parent directories): .git - Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. Version and environment notes - Gradle started: Welcome to Gradle 8.13! - This build uses Gradle 8.13 and warns that deprecated features will be incompatible with Gradle 9.0. Missing packages/files mentioned - The error stems from the workspace not being a git repository (no .git directory): fatal: not a git repository (or any of the parent directories): .git Summary of root cause - The Gradle build attempted to run a git command as part of evaluating the root project, but the workspace is not a git repository (no .git), causing exit code 128 and the overall Gradle build to fail with exit code 1.
# Stage 1: Build the project using Gradle wrapper
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /workspace
# Install git (Gradle wrapper may fetch dependencies from git-based repos during build)
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the entire repository into the build stage
COPY . .
# Initialize a minimal git repository to satisfy Gradle if it checks for git metadata
RUN git init && git add -A && git -c user.email="builder@example.com" -c user.name="Builder" commit -m "snapshot" || true
# Ensure wrapper is executable and can fetch Gradle
RUN chmod +x gradlew
# Build the project (this uses the Gradle wrapper, downloads dependencies)
RUN ./gradlew cleanBuild build collect uploadFiles --no-daemon --stacktrace
# Stage 2: Runtime image
FROM eclipse-temurin:21-jre
WORKDIR /app
# Create a non-root user for running the server
RUN useradd -m arclightuser
USER arclightuser
# Copy built jars from the build stage (preserve multiple jars in case of a multi-jar output)
COPY --from=builder /workspace/build/libs /app/libs
# Expose common Minecraft server port
EXPOSE 25565
# Start the server by locating the first jar and running it with nogui
CMD ["sh","-lc","JAR=$(ls -1 /app/libs/*.jar 2>/dev/null | head -n 1); if [ -z \"$JAR\" ]; then echo 'No jar found'; exit 1; fi; exec java -jar \"$JAR\" nogui"]
Build timed out after 600s
# Stage 1: Build the project using Gradle wrapper FROM eclipse-temurin:21-jdk AS builder WORKDIR /workspace # Copy the entire repository into the build stage COPY . . # Ensure wrapper is executable and can fetch Gradle RUN chmod +x gradlew # Build the project (skip tests for faster builds) (this uses the Gradle wrapper, downloads dependencies) RUN ./gradlew build -x test --no-daemon --stacktrace # Stage 2: Runtime image FROM eclipse-temurin:21-jre WORKDIR /app # Create a non-root user for running the server RUN useradd -m arclightuser USER arclightuser # Copy built jars from the build stage (preserve multiple jars in case of a multi-jar output) COPY --from=builder /workspace/build/libs /app/libs # Expose common Minecraft server port EXPOSE 25565 # Start the server by locating the first jar and running it with nogui CMD ["sh","-lc","JAR=$(ls -1 /app/libs/*.jar 2>/dev/null | head -n 1); if [ -z \"$JAR\" ]; then echo 'No jar found'; exit 1; fi; exec java -jar \"$JAR\" nogui"]
- Failing step (command/step): [builder 5/5] RUN ./gradlew build -x test --no-daemon --stacktrace - Exact error message and exit code to preserve: - BUILD FAILED in 2m 8s - ERROR: process "/bin/sh -c ./gradlew build -x test --no-daemon --stacktrace" did not complete successfully: exit code: 1 - A problem occurred evaluating root project 'arclight'. - A problem occurred starting process 'command 'git'' - Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'arclight'. - Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'git' - Caused by: java.io.IOException: Cannot run program "git" (in directory "/workspace"): Exec failed, error: 2 (No such file or directory) - Missing packages/files mentioned: - git binary is missing in the builder image (Git could not be started). - Version mismatch/info: - Gradle 8.13 is in use (Welcome to Gradle 8.13!). Indicates deprecations: "Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0."
# Stage 1: Build the project using Gradle wrapper
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /workspace
# Install git (required by Gradle for some dependencies during build)
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the entire repository into the build stage
COPY . .
# Ensure wrapper is executable and can fetch Gradle
RUN chmod +x gradlew
# Build the project (skip tests for faster builds) (this uses the Gradle wrapper, downloads dependencies)
RUN ./gradlew cleanBuild build collect --no-daemon --stacktrace
# Stage 2: Runtime image
FROM eclipse-temurin:21-jre
WORKDIR /app
# Create a non-root user for running the server
RUN useradd -m arclightuser
USER arclightuser
# Copy built jars from the build stage (preserve multiple jars in case of a multi-jar output)
COPY --from=builder /workspace/build/libs /app/libs
# Expose commonMinecraft server port
EXPOSE 25565
# Start the server by locating the first jar and running it with nogui
CMD ["sh","-lc","JAR=$(ls -1 /app/libs/*.jar 2>/dev/null | head -n 1); if [ -z \"$JAR\" ]; then echo 'No jar found'; exit 1; fi; exec java -jar \"$JAR\" nogui"]
Summary of Docker build error - Exact error messages (preserve): - A problem occurred evaluating root project 'arclight'. > Process 'command 'git'' finished with non-zero exit value 128 - fatal: not a git repository (or any of the parent directories): .git - BUILD FAILED in 2m 33s - Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. - BUILD FAILED in 2m 33s - You can use '--warning-mode all' to show the individual deprecation warnings ... - Exit codes: - The failing Gradle step ended with exit code 128 for the git process, and the overall Docker build step ended with exit code: 1. - Failing command/step: - [builder 6/6] RUN ./gradlew cleanBuild build collect --no-daemon --stacktrace - Dockerfile:16 - Missing packages/files mentioned: - The Git command failed because the workspace is not a Git repository: fatal: not a git repository (or any of the parent directories): .git - Implies missing .git metadata in /workspace during Gradle evaluation. - Version mismatch / related info: - Using Gradle 8.13 (Gradle 8.13 release notes shown in log). - Deprecation warning: "Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0." This indicates potential future incompatibility if the build is upgraded to Gradle 9.0.
# Stage 1: Build the project using Gradle wrapper
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /workspace
# Install git (required by Gradle for some dependencies during build)
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the entire repository into the build stage
COPY . .
# Initialize a minimal git repository to satisfy Gradle if it checks for git metadata
RUN git init && git config user.email="builder@example.com" && git config user.name="Builder" && git add -A && git commit -m "snapshot" || true
# Ensure wrapper is executable and can fetch Gradle
RUN chmod +x gradlew
# Build the project (skip tests for faster builds) (this uses the Gradle wrapper, downloads dependencies)
RUN ./gradlew cleanBuild build collect --no-daemon --stacktrace
# Stage 2: Runtime image
FROM eclipse-temurin:21-jre
WORKDIR /app
# Create a non-root user for running the server
RUN useradd -m arclightuser
USER arclightuser
# Copy built jars from the build stage (preserve multiple jars in case of a multi-jar output)
COPY --from=builder /workspace/build/libs /app/libs
# Expose common Minecraft server port
EXPOSE 25565
# Start the server by locating the first jar and running it with nogui
CMD ["sh","-lc","JAR=$(ls -1 /app/libs/*.jar 2>/dev/null | head -n 1); if [ -z \"$JAR\" ]; then echo 'No jar found'; exit 1; fi; exec java -jar \"$JAR\" nogui"]
Failing build summary - Failing step (Docker build): builder 7/7 RUN ./gradlew cleanBuild build collect --no-daemon --stacktrace - Exact error messages and exit codes to preserve - Process 'command 'git'' finished with non-zero exit value 128 - fatal: Needed a single revision - org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'arclight'. - Caused by: org.gradle.process.internal.ExecException: Process 'command 'git'' finished with non-zero exit value 128 - BUILD FAILED in 2m 32s - Exit code: 1 (the Docker build step exited with code 1) - Context and relevant details - Gradle version used: Gradle 8.13 (Welcome to Gradle 8.13!; downloaded gradle-8.13-all.zip) - Deprecation note: Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. - Missing packages or files - No missing packages/files explicitly reported. The error is triggered by a git command failure during Gradle evaluation. The build previously installed git/ca-certificates via apt-get, but no specific missing-file/package messages are shown as causing the failure. - Version mismatch / compatibility notes - Gradle 8.13 is in use; the log indicates deprecations that would be incompatible with Gradle 9.0.
# Stage 1: Build the project using Gradle wrapper
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /workspace
# Install git (required by Gradle for some dependencies during build)
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Create a git wrapper to avoid failing on non-git workspaces
RUN mkdir -p /usr/local/bin
RUN printf '%s' '#!/bin/sh\nREAL="/usr/bin/git"\ncase "$1" in\n describe) echo "v0.0.0-unknown"; exit 0;;\n rev-parse) if [ "$2" = "HEAD" ]; then echo "HEAD"; else "$REAL" "$@"; fi;;\n *) exec "$REAL" "$@";; esac\n' > /usr/local/bin/git \
&& chmod +x /usr/local/bin/git
# Copy the entire repository into the build stage
COPY . .
# Ensure wrapper is executable and can fetch Gradle
RUN chmod +x gradlew
# Build the project (skip tests for faster builds)
RUN ./gradlew build -x test --no-daemon --stacktrace
# Stage 2: Runtime image
FROM eclipse-temurin:21-jre
WORKDIR /app
# Create a non-root user for running the server
RUN useradd -m arclightuser
USER arclightuser
# Copy built jars from the build stage (preserve multiple jars in case of a multi-jar output)
COPY --from=builder /workspace/build/libs /app/libs
# Expose common Minecraft server port
EXPOSE 25565
# Start the server by locating the first jar and running it with nogui
CMD ["sh","-lc","JAR=$(ls -1 /app/libs/*.jar 2>/dev/null | head -n 1); if [ -z \"$JAR\" ]; then echo 'No jar found'; exit 1; fi; exec java -jar \"$JAR\" nogui"]
Summary (under 1500 chars): - Failing step: [builder 8/8] RUN ./gradlew build -x test --no-daemon --stacktrace (Dockerfile: line 21) - Exact error messages and exit code to preserve: - fatal: not a git repository (or any of the parent directories): .git - Process 'command 'git'' finished with non-zero exit value 128 - org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'arclight'. - Caused by: org.gradle.process.internal.ExecException: Process 'command 'git'' finished with non-zero exit value 128 - BUILD FAILED in 2m 55s - ERROR: failed to build: failed to solve: process "/bin/sh -c ./gradlew build -x test --no-daemon --stacktrace" did not complete successfully: exit code: 1 - Failing command/step: RUN ./gradlew build -x test --no-daemon --stacktrace - Missing packages or files mentioned: - The log shows a git failure due to “not a git repository,” indicating the workspace lacks a .git directory (likely not included in the build context). The specific line: fatal: not a git repository (or any of the parent directories): .git - Version mismatch / environment notes: - Gradle version shown: Gradle 8.13 (Welcome to Gradle 8.13!) - There is a deprecation warning: Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
# Multi-stage Dockerfile for Arclight
FROM eclipse-temurin:21-jdk as builder
WORKDIR /workspace
# Install prerequisites
RUN apt-get update \
&& apt-get install -y --no-install-recommends git curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy project
COPY . /workspace
# Ensure Gradle wrapper is executable
RUN chmod +x gradlew
# Build from source
RUN ./gradlew clean build --no-daemon
# Extract the built JAR (pick the first jar from build/libs)
RUN set -e; \
JAR_FILE=$(ls build/libs/*.jar 2>/dev/null | head -n 1); \
if [ -z "$JAR_FILE" ]; then \
echo "No jar found in build/libs"; \
exit 1; \
fi; \
cp "$JAR_FILE" /workspace/app.jar
# Runtime image
FROM eclipse-temurin:21-jre
WORKDIR /app
# Copy the built artifact
COPY --from=builder /workspace/app.jar /app/app.jar
# Create a non-root user and run as that user
RUN useradd -m arclight
USER arclight
# Run the server
CMD ["java","-jar","/app/app.jar"]
# Ignore git, build outputs, and IDE files .git build/ out/ .gradle/ .idea/ *.iml .DS_Store
- VerifyBuild status: build_failed
- Context/concerns:
- Suggest adding a .dockerignore to avoid copying large/relevant files into the build context.
- JAR selection copies the first jar from build/libs; if multiple jars exist, may pick an unintended artifact; consider targeting a specific artifact name or Gradle task.
- Failing command:
- RUN ./gradlew clean build --no-daemon (builder 6/7)
- Exact error messages and exit codes to preserve:
- fatal: not a git repository (or any of the parent directories): .git
- Process 'command 'git'' finished with non-zero exit value 128
- BUILD FAILED in 2m 39s
- 3 actionable tasks: 3 executed
- ERROR: process "/bin/sh -c ./gradlew clean build --no-daemon" did not complete successfully: exit code: 1
- Build file '/workspace/build.gradle' line: 18
- A problem occurred evaluating root project 'arclight'.
- > Process 'command 'git'' finished with non-zero exit value 128
- Missing packages/files mentioned:
- Git is installed, but the workspace is not a git repository:
- fatal: not a git repository (or any of the parent directories): .git
- The .git directory is missing from /workspace, causing git to fail during Gradle evaluation.
- Version mismatch / warnings:
- Gradle version: 8.13 (Welcome to Gradle 8.13!)
- Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
- You can use '--warning-mode all' to show the individual deprecation warnings.
- Minor casing warning not essential to the failure: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 3)
- Root cause note:
- The Gradle build invokes git, but the copied workspace lacks a .git directory, so the git command fails (exit code 128), causing Gradle root-project evaluation to fail and the Docker build to error with exit code 1.# Multi-stage Dockerfile for Arclight
FROM eclipse-temurin:21-jdk as builder
WORKDIR /workspace
# Install prerequisites
RUN apt-get update \
&& apt-get install -y --no-install-recommends git curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy project
COPY . /workspace
# Ensure Gradle wrapper is executable
RUN chmod +x gradlew
# Initialize a git repository in the workspace to satisfy Gradle's git usage
RUN git init \
&& git add -A \
&& git config user.email "docker@local" \
&& git config user.name "Docker" \
&& git commit -m "snapshot of source during docker build" || true
# Build from source
RUN ./gradlew clean build --no-daemon
# Extract the built JAR (pick the first jar from build/libs)
RUN set -e; \
JAR_FILE=$(ls build/libs/*.jar 2>/dev/null | head -n 1); \
if [ -z "$JAR_FILE" ]; then \
echo "No jar found in build/libs"; \
exit 1; \
fi; \
cp "$JAR_FILE" /workspace/app.jar
# Runtime image
FROM eclipse-temurin:21-jre
WORKDIR /app
# Copy the built artifact
COPY --from=builder /workspace/app.jar /app/app.jar
# Create a non-root user and run as that user
RUN useradd -m arclight
USER arclight
# Run the server
CMD ["java","-jar","/app/app.jar","nogui"]
Build timed out after 600s
# Multi-stage Dockerfile for Arclight
FROM eclipse-temurin:21-jdk as builder
WORKDIR /workspace
# Install prerequisites
RUN apt-get update \
&& apt-get install -y --no-install-recommends git curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy project
COPY . /workspace
# Ensure Gradle wrapper is executable
RUN chmod +x gradlew
# Initialize a git repository in the workspace to satisfy Gradle's git usage
RUN git init \
&& git add -A \
&& git -c user.name="Docker" -c user.email="docker@example.com" commit -m "docker build snapshot" --allow-empty
# Build from source
RUN ./gradlew clean build --no-daemon
# Extract the built JAR (pick the first jar from build/libs)
RUN set -e; \
JAR_FILE=$(ls -1 build/libs/*.jar 2>/dev/null | head -n 1); \
if [ -z "$JAR_FILE" ]; then \
echo "No jar found in build/libs"; \
exit 1; \
fi; \
cp "$JAR_FILE" /workspace/app.jar
# Runtime image
FROM eclipse-temurin:21-jre
WORKDIR /app
# Copy the built artifact
COPY --from=builder /workspace/app.jar /app/app.jar
# Create a non-root user and run as that user
RUN useradd -m arclight
USER arclight
# Run the server
CMD ["java","-jar","/app/app.jar","nogui"]
Build timed out after 600s
# Multi-stage Dockerfile for Arclight
FROM eclipse-temurin:21-jdk as builder
WORKDIR /workspace
# Install prerequisites
RUN apt-get update \
&& apt-get install -y --no-install-recommends git curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy project
COPY . /workspace
# Ensure Gradle wrapper is executable
RUN chmod +x gradlew
# Build from source
RUN ./gradlew clean build --no-daemon
# Extract the built JAR (pick the first jar from build/libs)
RUN set -e; \
JAR_FILE=$(ls -1 build/libs/*.jar 2>/dev/null | head -n 1); \
if [ -z "$JAR_FILE" ]; then \
echo "No jar found in build/libs"; \
exit 1; \
fi; \
cp "$JAR_FILE" /workspace/app.jar
# Runtime image
FROM eclipse-temurin:21-jre
WORKDIR /app
# Copy the built artifact
COPY --from=builder /workspace/app.jar /app/app.jar
# Create a non-root user and run as that user
RUN useradd -m arclight
USER arclight
# Expose Minecraft port (default)
EXPOSE 25565
# Run the server
CMD ["java","-jar","/app/app.jar","nogui"]
- Failing step (command): [builder 6/7] RUN ./gradlew clean build --no-daemon - Exact error message and exit code: - Inside Gradle: "A problem occurred evaluating root project 'arclight'. > Process 'command 'git'' finished with non-zero exit value 128" (git exited with code 128) - Outer Docker/Build error: "ERROR: failed to build: failed to solve: process \"/bin/sh -c ./gradlew clean build --no-daemon\" did not complete successfully: exit code: 1" - Build log shows: "BUILD FAILED in 3m 2s" - Missing packages or files mentioned: - "fatal: not a git repository (or any of the parent directories): .git" (git attempted to run in a non-Git repo) - Build file reference: "Build file '/workspace/build.gradle' line: 18" (the failing evaluation occurs during this Gradle run) - Version mismatch / relevant version info: - Gradle 8.13 is in use: "Welcome to Gradle 8.13!" - Deprecation note: "Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0." - Warnings to note (non-fatal): - "FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 3)" (Dockerfile:19)
# Multi-stage Dockerfile for Arclight
FROM eclipse-temurin:21-jdk as builder
WORKDIR /workspace
# Install prerequisites
RUN apt-get update \
&& apt-get install -y --no-install-recommends git curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Clone the repository to ensure a proper git history for Gradle
RUN git clone --depth 1 https://github.com/IzzelAliz/Arclight.git /workspace
WORKDIR /workspace
# Ensure Gradle wrapper is executable
RUN chmod +x gradlew
# Build from source
RUN ./gradlew clean build --no-daemon
# Extract the built JAR (pick a runnable jar from build/libs, excluding sources/javadoc jars)
RUN set -e; \
JAR_FILE=$(ls build/libs/*.jar 2>/dev/null | grep -v -- -sources.jar | head -n 1); \
if [ -z "$JAR_FILE" ]; then \
echo "No runnable jar found in build/libs"; \
exit 1; \
fi; \
cp "$JAR_FILE" /workspace/app.jar
# Runtime image
FROM eclipse-temurin:21-jre
WORKDIR /app
# Copy the built artifact
COPY --from=builder /workspace/app.jar /app/app.jar
# Create a non-root user and run as that user
RUN useradd -m arclight
USER arclight
# Expose Minecraft port (default)
EXPOSE 25565
# Run the server
CMD ["java","-jar","/app/app.jar","nogui"]
Build timed out after 600s
# Multi-stage Dockerfile for Arclight
FROM eclipse-temurin:21-jdk as builder
WORKDIR /workspace
# Install prerequisites
RUN apt-get update \
&& apt-get install -y --no-install-recommends git curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy project into the builder image
COPY . /workspace
# Initialize a git repository in the workspace to satisfy Gradle's git usage
RUN git init \
&& git add -A \
&& git -c user.name="Docker" -c user.email="docker@example.com" commit -m "docker build snapshot" --allow-empty
# Ensure Gradle wrapper is executable
RUN chmod +x gradlew
# Build from source
RUN ./gradlew clean build --no-daemon
# Extract the built JAR (prefer runnable jars, exclude sources/javadoc)
RUN set -e; \
JAR_FILE=$(ls build/libs/*.jar 2>/dev/null | grep -v -e 'sources.jar' -e 'javadoc.jar' | head -n 1); \
if [ -z "$JAR_FILE" ]; then \
echo "No runnable jar found in build/libs"; \
exit 1; \
fi; \
cp "$JAR_FILE" /workspace/app.jar
# Runtime image
FROM eclipse-temurin:21-jre
WORKDIR /app
# Copy the built artifact
COPY --from=builder /workspace/app.jar /app/app.jar
# Create a non-root user and run as that user
RUN useradd -m arclight
USER arclight
# Expose Minecraft port (default)
EXPOSE 25565
# Run the server
CMD ["java","-jar","/app/app.jar","nogui"]
Build timed out after 600s
# Multi-stage Dockerfile for Arclight
FROM eclipse-temurin:21-jdk as builder
WORKDIR /workspace
# Install prerequisites
RUN apt-get update \
&& apt-get install -y --no-install-recommends git curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy project into the builder image
COPY . /workspace
# Initialize a git repository in the workspace to satisfy Gradle's git usage
RUN git init \
&& git config user.name "Docker" \
&& git config user.email "docker@example.com" \
&& git add -A \
&& git commit -m "docker build snapshot" --allow-empty
# Ensure Gradle wrapper is executable
RUN chmod +x gradlew
# Build from source
RUN ./gradlew clean build --no-daemon
# Extract the built JAR (prefer runnable jars, exclude sources/javadoc)
RUN set -e; \
JAR_FILE=$(ls build/libs/*.jar 2>/dev/null | grep -v -e 'sources.jar' -e 'javadoc.jar' | head -n 1); \
if [ -z "$JAR_FILE" ]; then \
echo "No runnable jar found in build/libs"; \
exit 1; \
fi; \
cp "$JAR_FILE" /workspace/app.jar
# Runtime image
FROM eclipse-temurin:21-jre
WORKDIR /app
# Copy the built artifact
COPY --from=builder /workspace/app.jar /app/app.jar
# Create a non-root user and run as that user
RUN useradd -m arclight
USER arclight
# Expose Minecraft port (default)
EXPOSE 25565
# Run the server
CMD ["java","-jar","/app/app.jar","nogui"]
Build timed out after 600s
# Multi-stage Dockerfile for Arclight using GitHub source
FROM eclipse-temurin:21-jdk as builder
WORKDIR /workspace
# Install prerequisites
RUN apt-get update \
&& apt-get install -y --no-install-recommends git curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Clone the repository to ensure a proper git history for Gradle
RUN git clone --depth 1 https://github.com/IzzelAliz/Arclight.git /workspace
WORKDIR /workspace
# Ensure Gradle wrapper is executable
RUN chmod +x gradlew
# Build from source
RUN ./gradlew clean build --no-daemon
# Extract the built JAR (prefer runnable jars, exclude sources/javadoc)
RUN set -e; \
JAR_FILE=$(ls build/libs/*.jar 2>/dev/null | grep -v -e 'sources.jar' -e 'javadoc.jar' | head -n 1); \
if [ -z "$JAR_FILE" ]; then \
echo "No runnable jar found in build/libs"; \
exit 1; \
fi; \
cp "$JAR_FILE" /workspace/app.jar
# Runtime image
FROM eclipse-temurin:21-jre
WORKDIR /app
# Copy the built artifact
COPY --from=builder /workspace/app.jar /app/app.jar
# Create a non-root user and run as that user
RUN useradd -m arclight
USER arclight
# Expose Minecraft port (default)
EXPOSE 25565
# Run the server
CMD ["java","-jar","/app/app.jar","nogui"]
Build timed out after 600s
Summary (under 1500 chars):
- Plugins (global): architectury-plugin 3.4-SNAPSHOT (apply false); dev.architectury.loom apply false; com.gradleup.shadow 8.3.+ (apply false).
- Allprojects:
- group: io.izzel.arclight; version: 1.0.2-SNAPSHOT.
- getGitHash() runs: git rev-parse --short HEAD.
- ext vars: versionName=feudal-kings; gitHash from getGitHash(); supportedPlatforms=[forge, neoforge, fabric]; platformProjects=[forge, fabric, neoforge]; subProjects = platformProjects + arclight-common; generatedSpigot = "io.izzel.arclight.generated:spigot:${libs.versions.minecraft.get()}:deobf".
- Java toolchain: languageVersion 21.
- Repositories: Sponge, Sonatype snapshots, Spigot snapshots, neoforged, Forge maven, izzel releases, mavenCentral, mavenLocal.
- Dependencies: lombok (compileOnly & annotationProcessor), JetBrains annotations (compileOnly).
- cleanBuild task: deletes build/libs.
- Subprojects (rootProject.ext.subProjects):
- Apply: architectury-plugin, dev.architectury.loom, ArclightGradlePlugin.
- architectury.minecraft = libs.versions.minecraft.get().
- loom.silentMojangMappingsLicense().
- arclight: mcVersion = libs.versions.minecraft.get(); bukkitVersion = libs.versions.bukkit.api.get(); spigotReversion = libs.versions.spigot.reversion.get(); accessTransformer = root/ext.commonProject.file('bukkit.at'); extraMapping = root/ext.commonProject.file('extra_mapping.tsrg').
- Configs:
- common: canBeResolved true, canBeConsumed false.
- compileClasspath, runtimeClasspath, developmentForge, developmentFabric, developmentNeoForge extendFrom common.
- shadowBundle: canBeResolved true, canBeConsumed false.
- Dependencies: minecraft libs.minecraft; mappings loom.layered() with officialMojangMappings and parchment from parchment-${minecraft}:${parchment}.
- Java: withSourcesJar().
- Platform projects (rootProject.ext.platformProjects):
- Apply: dev.architectury.loom, com.gradleup.shadow.
- loom.accessWidenerPath = root/commonProject.loom.accessWidenerPath.
- Jar manifest attributes:
- MixinConnector = io.izzel.arclight.common.mod.ArclightConnector
- Implementation-Title = Arclight
- Implementation-Version = "${p.name}-${libs.versions.minecraft.get()}-${project.version}+$gitHash"
- Implementation-Vendor = Arclight Team
- Implementation-Timestamp = current date/time
- components.java: skip variants from shadowRuntimeElements.
- Jar task: jar.enabled = false.
- collect task (Copy): destinationDir build/libs; from bootstrap Forge/NeoForge/Fabric jar outputs.
- Helper: gitBranch() runs git rev-parse --abbrev-ref HEAD.
- uploadFiles task (UploadFilesTask):
- mcVersion = libs.versions.minecraft
- version = "${project.version}-${project.ext.gitHash}"
- snapshot = project.version endsWith('-SNAPSHOT')
- gitHash = project.ext.gitHash
- branch = gitBranch()
- inputs.files from tasks.collect.outputs.files
- dependsOn tasks.collect
- Key file/paths: build/libs, bukkit.at, extra_mapping.tsrg, bootstrap project jar outputs.# Build Arclight from source with Gradle, using a two-stage Dockerfile
FROM openjdk:21-jdk-slim AS builder
WORKDIR /workspace
# Install essential build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends git curl unzip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy Gradle tooling and project metadata early for better caching
COPY gradlew ./gradlew
COPY gradle ./gradle
COPY settings.gradle ./settings.gradle
COPY build.gradle ./build.gradle
# If the project uses a multi-module layout, ensure module build files are included
COPY arclight-common/build.gradle ./arclight-common/build.gradle
# Copy all source trees (best effort: copy everything to allow Gradle to resolve dependencies)
COPY arclight-common ./arclight-common
COPY . .
# Ensure the Gradle wrapper is executable
RUN chmod +x ./gradlew
# Build the project from source, enabling build-cache and parallelism
RUN ./gradlew cleanBuild build collect uploadFiles --no-daemon --build-cache --parallel --stacktrace
# Runtime image
FROM eclipse-temurin:21-jre AS runtime
WORKDIR /app
# Copy built artifacts from the builder stage
COPY --from=builder /workspace/build/libs /app/libs
# Pick a runnable jar deterministically (skip sources/javadoc jars)
RUN set -eux; JAR=$(ls /app/libs/*.jar 2>/dev/null | head -n 1); \
if [ -z "$JAR" ]; then echo "No runnable jar found"; exit 1; fi; \
cp "$JAR" /app/arclight.jar
# Expose the default Minecraft server port
EXPOSE 25565
# Run the server (nogui for headless container)
ENTRYPOINT ["java", "-jar", "/app/arclight.jar", "nogui"]
# Build Arclight from source with Gradle, using a two-stage Dockerfile
FROM openjdk:21-jdk AS builder
WORKDIR /workspace
# Install essential build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends git curl unzip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy Gradle tooling and project metadata early for better caching
COPY gradlew ./gradlew
COPY gradle ./gradle
COPY settings.gradle ./settings.gradle
COPY build.gradle ./build.gradle
# If the project uses a multi-module layout, ensure module build files are included
COPY arclight-common/build.gradle ./arclight-common/build.gradle
# Copy source tree(s) to enable Gradle to resolve dependencies
COPY arclight-common ./arclight-common
COPY . .
# Ensure the Gradle wrapper is executable
RUN chmod +x ./gradlew
# Build the project from source, enabling build-cache and parallelism
RUN ./gradlew cleanBuild build collect uploadFiles --no-daemon --build-cache --parallel --stacktrace
# Runtime image
FROM eclipse-temurin:21-jre AS runtime
WORKDIR /app
# Copy built artifacts from the builder stage
COPY --from=builder /workspace/build/libs /app/libs
# Pick a runnable jar deterministically (skip sources/javadoc jars)
RUN set -eux; JAR=$(ls /app/libs/*.jar 2>/dev/null | head -n 1); \
if [ -z "$JAR" ]; then echo "No runnable jar found"; exit 1; fi; \
cp "$JAR" /app/arclight.jar
# Expose the default Minecraft server port
EXPOSE 25565
# Run the server (nogui for headless container)
ENTRYPOINT ["java", "-jar", "/app/arclight.jar", "nogui"]
# Build Arclight from source with Gradle, using a two-stage Dockerfile
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /workspace
# Install essential build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends git curl unzip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy Gradle tooling and project metadata early for better caching
COPY gradlew ./gradlew
COPY gradle ./gradle
COPY settings.gradle ./settings.gradle
COPY build.gradle ./build.gradle
# If the project uses a multi-module layout, ensure module build files are included
COPY arclight-common/build.gradle ./arclight-common/build.gradle
# Copy source tree(s) to enable Gradle to resolve dependencies
COPY arclight-common ./arclight-common
COPY . .
# Ensure the Gradle wrapper is executable
RUN chmod +x ./gradlew
# Build the project from source, enabling build-cache and parallelism
RUN ./gradlew cleanBuild build collect uploadFiles --no-daemon --build-cache --parallel --stacktrace
# Runtime image
FROM eclipse-temurin:21-jre AS runtime
WORKDIR /app
# Copy built artifacts from the builder stage
COPY --from=builder /workspace/build/libs /app/libs
# Pick a runnable jar deterministically (skip sources/javadoc jars)
RUN set -eux; JAR=$(ls /app/libs/*-all.jar 2>/dev/null | head -n 1); \
if [ -z "$JAR" ]; then echo "No runnable jar found"; exit 1; fi; \
cp "$JAR" /app/arclight.jar
# Expose the default Minecraft server port
EXPOSE 25565
# Run the server (nogui for headless container)
ENTRYPOINT ["java", "-jar", "/app/arclight.jar", "nogui"]
- Failing step (command): [builder 12/12] RUN ./gradlew cleanBuild build collect uploadFiles --no-daemon --build-cache --parallel --stacktrace
- Exact error messages and exit code to preserve:
- fatal: not a git repository (or any of the parent directories): .git
- A problem occurred evaluating root project 'arclight'.
> Process 'command 'git'' finished with non-zero exit value 128
- Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
- BUILD FAILED in 2m 22s
- exit code: 1
- Missing packages or files mentioned:
- The fatal git message implies there is no .git repository in the workspace (fatal: not a git repository ...). No other specific missing package/file errors are shown.
- Version mismatch / relevant version info:
- Gradle 8.13 is being used (Welcome to Gradle 8.13!).
- Build warns: Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.# Build Arclight from source with Gradle, using a two-stage Dockerfile
FROM eclipse-temurin:21-jre AS builder
WORKDIR /workspace
# Install essential build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends git curl unzip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy Git metadata to support Gradle plugins that rely on git (if present)
COPY .git ./.git
# Copy Gradle tooling and project metadata early for better caching
COPY gradlew ./gradlew
COPY gradle ./gradle
COPY settings.gradle ./settings.gradle
COPY build.gradle ./build.gradle
# If the project uses a multi-module layout, ensure module build files are included
COPY arclight-common/build.gradle ./arclight-common/build.gradle
# Copy source tree(s) to enable Gradle to resolve dependencies
COPY arclight-common ./arclight-common
COPY . .
# Ensure the Gradle wrapper is executable
RUN chmod +x ./gradlew
# Build the project from source, enabling build-cache and parallelism
RUN ./gradlew clean build --no-daemon --build-cache --parallel
# Runtime image
FROM eclipse-temurin:21-jre AS runtime
WORKDIR /app
# Create a non-root user for running the application
RUN groupadd -r arc && useradd -r -g arc arc
# Copy built artifacts from the builder stage
COPY --from=builder /workspace/build/libs /app/libs
# Pick a runnable jar deterministically (skip sources/javadoc jars)
RUN set -eux; JAR=$(ls /app/libs/*-all.jar 2>/dev/null | head -n 1); \
if [ -z "$JAR" ]; then echo "No runnable jar found"; exit 1; fi; \
cp "$JAR" /app/arclight.jar; \
chown arc:arc /app/arclight.jar
# Expose the default Minecraft server port
EXPOSE 25565
# Run the server (nogui for headless container)
USER arc
ENTRYPOINT ["java", "-jar", "/app/arclight.jar", "nogui"]
Concerns: Builder stage uses a JRE base image; Gradle requires a JDK to compile Java sources, so the build will fail because javac and other JDK tooling are missing., No handling for Minecraft EULA acceptance inside the image; the server may exit if eula.txt is not present or eula=true., Potential mismatch if the build outputs a jar name that doesn't match '*-all.jar', causing the runtime image to fail to find arclight.jar.
Concerns: Builder stage uses eclipse-temurin:21-jre which does not include a JDK; Gradle build requires a JDK. The build will fail., The artifact discovery step relies on a -all.jar being produced (ls /app/libs/*-all.jar); if the project does not generate such a jar, the image build will fail., COPY .git ./.git is potentially unnecessary and may rely on .git being present in the build context; it can bloat the image or cause build context issues. Consider excluding .git via .dockerignore or removing git metadata from the runtime image.
# Build Arclight from source with Gradle, using a two-stage Dockerfile
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /workspace
# Install essential build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends git curl unzip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy Gradle tooling and project metadata for caching
COPY gradlew ./gradlew
COPY gradle ./gradle
COPY settings.gradle ./settings.gradle
COPY build.gradle ./build.gradle
# If the project uses a multi-module layout, ensure module build files are included
COPY arclight-common/build.gradle ./arclight-common/build.gradle
# Copy source tree(s) to enable Gradle to resolve dependencies
COPY arclight-common ./arclight-common
COPY . .
# Ensure the Gradle wrapper is executable
RUN chmod +x ./gradlew
# Build the project from source, enabling build-cache and parallelism
RUN ./gradlew clean build --no-daemon --build-cache --parallel
# Runtime image
FROM eclipse-temurin:21-jre AS runtime
WORKDIR /app
# Create a non-root user for running the application
RUN groupadd -r arc && useradd -r -g arc arc
# Copy built artifacts from the builder stage
COPY --from=builder /workspace/build/libs /app/libs
# Pick a runnable jar deterministically (skip sources/javadoc jars)
RUN set -eux; JAR=$(ls /app/libs/*-all.jar 2>/dev/null | head -n 1); \
if [ -z "$JAR" ]; then echo "No runnable jar found"; exit 1; fi; \
cp "$JAR" /app/arclight.jar; \
chown arc:arc /app/arclight.jar
# Expose the default Minecraft server port
EXPOSE 25565
# Run the server (nogui for headless container)
USER arc
ENTRYPOINT ["java", "-jar", "/app/arclight.jar", "nogui"]
Summary: - Exact error message and exit code: - BUILD FAILED in 1m 42s - A problem occurred evaluating root project 'arclight'. > Process 'command 'git'' finished with non-zero exit value 128 - fatal: not a git repository (or any of the parent directories): .git - Build file '/workspace/build.gradle' line: 18 - Deeper Gradle notes about deprecations and guidance appear after failure - The failure ended with: process "/bin/sh -c ./gradlew clean build --no-daemon --build-cache --parallel" did not complete successfully: exit code: 1 - Failing command/step: - [builder 12/12] RUN ./gradlew clean build --no-daemon --build-cache --parallel - Dockerfile segment shows this as line 27 - Missing packages or files mentioned: - The log shows Git was invoked but the workspace is not a Git repository: fatal: not a git repository (or any of the parent directories): .git - This suggests the build expected a .git context (or git metadata) in /workspace, which is not present - Version mismatch/info: - Gradle version: 8.13 (Welcome to Gradle 8.13!) - Java toolchains: builder uses eclipse-temurin:21-jdk; runtime uses eclipse-temurin:21-jre - Warnings: Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0 - Additional Gradle guidance appears (stacktrace/diagnostics options recommended) but not explored due to failure Notes: - The root cause appears to be invoking git in a workspace that lacks a .git directory, causing exit value 128 and a failed root project evaluation. This blocks the Gradle build step despite other steps succeeding.
Summary:
- Plugins
- architectury-plugin: 3.4-SNAPSHOT
- dev.architectury.loom: version from gradle/libs.versions.toml
- com.gradleup.shadow: 8.3.+
- Project metadata
- group: io.izzel.arclight
- version: 1.0.2-SNAPSHOT
- versionName: feudal-kings
- gitHash = result of git rev-parse --short HEAD
- supportedPlatforms: forge, neoforge, fabric
- generatedSpigot: io.izzel.arclight.generated:spigot:${libs.versions.minecraft.get()}:deobf
- Git utilities
- getGitHash(): runs git rev-parse --short HEAD
- gitBranch(): runs git rev-parse --abbrev-ref HEAD
- Java toolchain
- languageVersion: 21
- Repositories (selected)
- https://repo.spongepowered.org/maven
- https://oss.sonatype.org/content/repositories/snapshots/
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/
- https://maven.neoforged.net/releases
- https://files.minecraftforge.net/maven/
- https://maven.izzel.io/releases
- mavenCentral(), mavenLocal()
- Dependencies (root)
- compileOnly lombok
- annotationProcessor lombok
- compileOnly org.jetbrains:annotations
- Custom tasks
- cleanBuild: deletes build/libs
- Subprojects (rootProject.ext.subProjects)
- Apply: architectury-plugin, loom, ArclightGradlePlugin
- architectury.minecraft = libs.versions.minecraft.get()
- loom.silentMojangMappingsLicense()
- arclight: mcVersion/libs.versions.minecraft.get(), bukkitVersion/libs.versions.bukkit.api.get(), spigotReversion/libs.versions.spigot.reversion.get(), accessTransformer=rootProject.ext.commonProject.file('bukkit.at'), extraMapping=rootProject.ext.commonProject.file('extra_mapping.tsrg')
- configurations: common (canBeResolved true, canBeConsumed false), shadowBundle (canBeResolved true, canBeConsumed false)
- dependencies: minecraft libs.minecraft; mappings loom.layered() with officialMojangMappings() and parchment-<minecraft>:<parchment>@
- java: withSourcesJar()
- Platform projects (rootProject.ext.platformProjects)
- Apply: loom, shadow
- loom.accessWidenerPath = root projects commonProject.loom.accessWidenerPath
- jar.manifest attributes:
- MixinConnector: io.izzel.arclight.common.mod.ArclightConnector
- Implementation-Title: Arclight
- Implementation-Version: "${p.name}-${libs.versions.minecraft.get()}-${project.version}+$gitHash"
- Implementation-Vendor: Arclight Team
- Implementation-Timestamp: current timestamp
- components.java: exclude variants from shadowRuntimeElements
- jar.enabled = false (global)
- collect task
- Type: Copy
- destinationDir: build/libs
- from outputs of bootstrap jars: forgeJar, neoforgeJar, fabricJar
- Upload
- Task: UploadFilesTask
- mcVersion = libs.versions.minecraft
- version = "${project.version}-${project.ext.gitHash}"
- snapshot = project.version endsWith('-SNAPSHOT')
- gitHash = project.ext.gitHash
- branch = gitBranch()
- inputs.files from collect.outputs
- dependsOn collect
- Key file references
- accessTransformer: rootProject.ext.commonProject.file('bukkit.at')
- extraMapping: rootProject.ext.commonProject.file('extra_mapping.tsrg')
- bootstrap jar outputs: project(':bootstrap').tasks.forgeJar.outputs, neoforgeJar.outputs, fabricJar.outputs
- Important package/name references
- io.izzel.arclight (root package)
- io.izzel.arclight.common.mod.ArclightConnector
Notes: No errors shown; this is the build configuration and task wiring for Arclight multi-platform projects with Git integrado versioning and upload.# Build Arclight from source with Gradle, using a two-stage Dockerfile
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /workspace
# Install essential build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends git curl unzip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy Gradle tooling and project metadata for caching
COPY gradlew ./gradlew
COPY gradle ./gradle
COPY settings.gradle ./settings.gradle
COPY build.gradle ./build.gradle
# If the project uses a multi-module layout, ensure module build files are included
COPY arclight-common/build.gradle ./arclight-common/build.gradle
# Copy source tree to enable Gradle to resolve dependencies
COPY arclight-common ./arclight-common
COPY . .
# Ensure the Gradle wrapper is executable
RUN chmod +x ./gradlew
# Initialize a git repository locally to satisfy Gradle's git hash computation when .git is absent in the build context
RUN git init && \
git config user.name "ArclightCI" && \
git config user.email "ci@example.com" && \
git commit --allow-empty -m "initial commit for git hash"
# Build the project from source, enabling build-cache and parallelism
RUN ./gradlew clean build --no-daemon --build-cache --parallel
# Runtime image
FROM eclipse-temurin:21-jre AS runtime
WORKDIR /app
# Create a non-root user for running the application
RUN groupadd -r arc && useradd -r -g arc arc
# Copy built artifacts from the builder stage
COPY --from=builder /workspace/build/libs /app/libs
# Pick a runnable jar deterministically (skip sources/javadoc jars)
RUN set -eux; JAR=$(ls /app/libs/*-all.jar 2>/dev/null | head -n 1); \
if [ -z "$JAR" ]; then echo "No runnable jar found"; exit 1; fi; \
cp "$JAR" /app/arclight.jar; \
chown arc:arc /app/arclight.jar
# Expose the default Minecraft server port
EXPOSE 25565
# Run the server (nogui for headless container)
USER arc
ENTRYPOINT ["java", "-jar", "/app/arclight.jar", "nogui"]
Build timed out after 600s
Build timed out after 600s
# Build Arclight from source with Gradle, using a two-stage Dockerfile
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /workspace
# Install essential build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends git curl unzip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy Gradle tooling and project metadata for caching
COPY gradlew ./gradlew
COPY gradle ./gradle
COPY settings.gradle ./settings.gradle
COPY build.gradle ./build.gradle
# If the project uses a multi-module layout, ensure module build files are included
COPY arclight-common/build.gradle ./arclight-common/build.gradle
# Copy source tree to enable Gradle to resolve dependencies
COPY arclight-common ./arclight-common
COPY . .
# Ensure the Gradle wrapper is executable
RUN chmod +x ./gradlew
# Initialize a local git repository to satisfy Gradle's git hash computation when .git isn't present in the build context
RUN git init && \
git config user.name "ArclightCI" && \
git config user.email "ci@example.com" && \
git commit --allow-empty -m "initial commit for git hash"
# Build the project from source, enabling build-cache and parallelism
RUN ./gradlew clean build --no-daemon --build-cache --parallel
# Runtime image
FROM eclipse-temurin:21-jre AS runtime
WORKDIR /app
# Create a non-root user for running the application
RUN groupadd -r arc && useradd -r -g arc arc
# Copy built artifacts from the builder stage
COPY --from=builder /workspace/build/libs /app/libs
# Copy a runnable jar deterministically (fallback: any jar in libs)
RUN set -e; JARS=("/app/libs"/*.jar); if [ -f "${JARS[0]}" ]; then cp "${JARS[0]}" /app/arclight.jar; else echo 'No jar found in build/libs'; exit 1; fi
# Expose the default Minecraft server port
EXPOSE 25565
# Run the server (nogui for headless container)
USER arc
ENTRYPOINT ["java", "-jar", "/app/arclight.jar", "nogui"]
Concerns: The runtime stage uses a shell command with Bash-style array syntax (JARS=("/app/libs"/*.jar); ... ${JARS[0]}) which is invalid in /bin/sh (POSIX shell) and will fail during the build of the runtime image., Jar copying logic is brittle and relies on the first jar in build/libs; this is non-deterministic and fragile if multiple jars are produced or naming changes occur., No HEALTHCHECK or minimal runtime verification is provided; additional checks could help ensure the container is usable beyond just building the jar.# Build Arclight from source with Gradle, using a two-stage Dockerfile
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /workspace
# Install essential build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends git curl unzip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy Gradle tooling and project metadata for caching
COPY gradlew ./gradlew
COPY gradle ./gradle
COPY settings.gradle ./settings.gradle
COPY build.gradle ./build.gradle
# Copy source tree to enable Gradle to resolve dependencies
COPY arclight-common ./arclight-common
COPY . .
# Ensure the Gradle wrapper is executable
RUN chmod +x ./gradlew
# Initialize a local git repository to satisfy Gradle's git hash computation when .git isn't present in the build context
RUN git init && \
git config user.name "ArclightCI" && \
git config user.email "ci@example.com" && \
git commit --allow-empty -m "initial commit for git hash"
# Build the project from source, enabling build-cache and parallelism
RUN ./gradlew clean build --no-daemon --build-cache --parallel
# Runtime image
FROM eclipse-temurin:21-jre AS runtime
WORKDIR /app
# Create a non-root user for running the application
RUN groupadd -r arc && useradd -r -g arc arc
# Copy built artifacts from the builder stage
COPY --from=builder /workspace/build/libs /app/libs
# Copy a runnable jar deterministically (first -all.jar if present, else first jar)
RUN set -e; JAR="$(ls /app/libs/*-all.jar 2>/dev/null | head -n 1)"; if [ -n "$JAR" ]; then cp "$JAR" /app/arclight.jar; else JAR="$(ls /app/libs/*.jar 2>/dev/null | head -n 1)"; if [ -n "$JAR" ]; then cp "$JAR" /app/arclight.jar; else echo 'No runnable jar found'; exit 1; fi; fi
# Expose the default Minecraft server port
EXPOSE 25565
# Run the server (nogui for headless container)
USER arc
ENTRYPOINT ["java", "-jar", "/app/arclight.jar", "nogui"]
Build timed out after 600s
# Build Arclight from source with Gradle, using a two-stage Dockerfile
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /workspace
# Install essential build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends git curl unzip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy Gradle tooling for caching
COPY gradlew ./gradlew
COPY gradle ./gradle
COPY settings.gradle ./settings.gradle
COPY build.gradle ./build.gradle
# Copy source tree to enable Gradle to resolve dependencies
COPY arclight-common ./arclight-common
COPY . .
# Ensure the Gradle wrapper is executable
RUN chmod +x ./gradlew
# Build the project from source, enabling build-cache and parallelism
RUN ./gradlew clean build --no-daemon --build-cache --parallel
# Runtime image
FROM eclipse-temurin:21-jre AS runtime
WORKDIR /app
# Create a non-root user for running the application
RUN groupadd -r arc && useradd -r -g arc arc
# Copy built artifacts from the builder stage
COPY --from=builder /workspace/build/libs /app/libs
# Copy a runnable jar deterministically (first -all.jar if present, else first jar)
RUN set -e; JAR="$(ls /app/libs/*-all.jar 2>/dev/null | head -n 1)"; if [ -n "$JAR" ]; then cp "$JAR" /app/arclight.jar; else JAR="$(ls /app/libs/*.jar 2>/dev/null | head -n 1)"; if [ -n "$JAR" ]; then cp "$JAR" /app/arclight.jar; else echo 'No runnable jar found'; exit 1; fi; fi
# Expose the default Minecraft server port
EXPOSE 25565
# Run the server (nogui for headless container)
USER arc
ENTRYPOINT ["java", "-jar", "/app/arclight.jar", "nogui"]
Failing step - Builder step: RUN ./gradlew clean build --no-daemon --build-cache --parallel Exact error messages and exit code - fatal: not a git repository (or any of the parent directories): .git - Process 'command 'git'' finished with non-zero exit value 128 - BUILD FAILED in 2m 37s - Where: Build file '/workspace/build.gradle' line: 18 - A problem occurred evaluating root project 'arclight'. - [Incubating] Problems report is available at: file:///workspace/build/reports/problems/problems-report.html - 3 actionable tasks: 3 executed - Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. - Gradle 8.13 is running (Welcome to Gradle 8.13!) Exit code - The Docker build reported: failed to solve: process "/bin/sh -c ./gradlew clean build --no-daemon --build-cache --parallel" did not complete successfully: exit code: 1 Missing packages or files mentioned - The error indicates the project directory is not a Git repository (no .git directory present), causing the git command to fail: - "fatal: not a git repository (or any of the parent directories): .git" - No explicit missing OS packages were reported; apt-get steps were cached earlier. Version mismatch / environment notes - Gradle version: 8.13 (Gradle 8.13) - Declarations about deprecations: "Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0." - The failure occurs during evaluation of build.gradle at line 18 due to a Git-related operation inside a non-Git workspace.
# Build Arclight from source with Gradle, using a two-stage Dockerfile
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /workspace
# Install essential build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends git curl unzip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy Gradle tooling for caching
COPY gradlew ./gradlew
COPY gradle ./gradle
COPY settings.gradle ./settings.gradle
COPY build.gradle ./build.gradle
# Copy source representation for multi-module setup
COPY arclight-common/build.gradle ./arclight-common/build.gradle
# Copy project sources
COPY arclight-common ./arclight-common
COPY . .
# Ensure the Gradle wrapper is executable
RUN chmod +x ./gradlew
# Initialize a local git repository to satisfy Gradle's git hash computation when .git isn't present in the build context
RUN git init && \
git config user.name "ArclightCI" && \
git config user.email "ci@example.com" && \
git add -A && git commit -m "initial commit for docker build"
# Build the project from source, enabling build-cache and parallelism
RUN ./gradlew clean build --no-daemon --build-cache --parallel
# Produce a runnable jar from the built libs
RUN set -e; \
ARCLIGHT_JAR=""; \
for f in /workspace/build/libs/*.jar; do \
if [[ "$f" != *sources.jar && "$f" != *javadoc.jar ]]; then ARCLIGHT_JAR="$f"; break; fi; \
done; \
if [ -z "$ARCLIGHT_JAR" ]; then echo "No runnable jar found"; exit 1; fi; \
cp "$ARCLIGHT_JAR" /workspace/arclight.jar
FROM eclipse-temurin:21-jre AS runtime
WORKDIR /app
# Create a non-root user for running the application
RUN groupadd -r arc && useradd -r -g arc arc
# Copy the runnable jar from the builder stage
COPY --from=builder /workspace/arclight.jar /app/arclight.jar
# Expose the server port
EXPOSE 25565
# Run the server (nogui for headless container)
USER arc
ENTRYPOINT ["java", "-jar", "/app/arclight.jar", "nogui"]
Concerns: The RUN block uses Bash-specific syntax [[ ... ]] within a POSIX /bin/sh context, which will fail during docker build on the eclipse-temurin base image (which uses /bin/sh)., The artifact discovery path assumes /workspace/build/libs/*.jar contains the runnable jar; for a multi-module Gradle project the jar may be in a module-specific or different directory (e.g., arclight-common/build/libs), risking no jar being found., If no runnable jar matches the expected pattern, the build will error out with 'No runnable jar found', making the image build brittle.
version: '3'
services:
arclight:
build:
context: .
ports:
- "25565:25565"
.git build/ out/ dist/ **/node_modules **/*.log **/.gradle/ .gradle/
Concerns: The RUN step uses bash-specific syntax ([[ ... ]]) which is not portable to /bin/sh. The eclipse-temurin:21-jdk image (and many similar Debian-based images) provide /bin/sh as dash, which will fail with [[ ... ]] syntax., There is a potential minor inconsistency in copying arclight-common/build.gradle before copying the arclight-common directory, which is not harmful but odd and could be simplified.
# Build Arclight from source with Gradle, using a two-stage Dockerfile
FROM eclipse-temurin:21-jdk AS builder
WORKDIR /workspace
# Install essential build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends git curl unzip ca-certificates && \
rm -rf /var/lib/apt/lists/*
# Copy Gradle tooling for caching
COPY gradlew ./gradlew
COPY gradle ./gradle
COPY settings.gradle ./settings.gradle
COPY build.gradle ./build.gradle
# Copy project sources
COPY arclight-common ./arclight-common
COPY . .
# Ensure the Gradle wrapper is executable
RUN chmod +x ./gradlew
# Initialize a local git repository to satisfy Gradle's git hash computation when .git isn't present in the build context
RUN git init && \
git config user.name "ArclightCI" && \
git config user.email "ci@example.com" && \
git add -A && git commit -m "docker build init"
# Build the project from source, enabling build-cache and parallelism
RUN ./gradlew cleanBuild build collect --no-daemon --build-cache --parallel
# Produce a runnable jar from the built libs
RUN set -e; JAR_PATH=$(ls build/libs/*-all.jar 2>/dev/null | head -n 1); \
if [ -z "$JAR_PATH" ]; then JAR_PATH=$(ls build/libs/*.jar 2>/dev/null | head -n 1); fi; \
if [ -z "$JAR_PATH" ]; then echo "No runnable jar found"; exit 1; fi; \
cp "$JAR_PATH" arclight.jar
FROM eclipse-temurin:21-jre AS runtime
WORKDIR /app
# Create a non-root user for running the application
RUN groupadd -r arc && useradd -r -g arc arc
# Copy the runnable jar from the builder stage
COPY --from=builder /workspace/arclight.jar /app/arclight.jar
# Expose the server port
EXPOSE 25565
# Run the server (nogui for headless container)
USER arc
ENTRYPOINT ["java", "-jar", "/app/arclight.jar", "nogui"]