Skip to content

Modern Docker Management, Designed for Everyone

chore: refactor dockerfiles for next builds

Kyle Mendelle310fae7a372
diff --git a/.github/workflows/build-next-images.yml b/.github/workflows/build-next-images.yml
index a4b4d551e..54334f75c 100644
--- a/.github/workflows/build-next-images.yml
+++ b/.github/workflows/build-next-images.yml
@@ -73,26 +73,52 @@ jobs:
echo "manager=ghcr.io/${REPO_OWNER,,}/arcane" >> $GITHUB_OUTPUT
echo "agent=ghcr.io/${REPO_OWNER,,}/arcane-headless" >> $GITHUB_OUTPUT
- - name: Build and push manager image
+ # Alpine variants (base :next tag)
+ - name: Build and push manager image (Alpine)
uses: depot/build-push-action@v1
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.image-names.outputs.manager }}:next
- file: docker/Dockerfile-static
+ file: docker/next-builds/Dockerfile-static
build-args: |
VERSION=next
REVISION=${{ github.sha }}
- - name: Build and push agent image
+ - name: Build and push agent image (Alpine)
uses: depot/build-push-action@v1
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.image-names.outputs.agent }}:next
- file: docker/Dockerfile-agent-static
+ file: docker/next-builds/Dockerfile-agent-static
+ build-args: |
+ VERSION=next
+ REVISION=${{ github.sha }}
+
+ # Distroless variants (:next-distroless tag)
+ - name: Build and push manager image (Distroless)
+ uses: depot/build-push-action@v1
+ with:
+ context: .
+ platforms: linux/amd64,linux/arm64,linux/arm/v7
+ push: true
+ tags: ${{ steps.image-names.outputs.manager }}:next-distroless
+ file: docker/next-builds/Dockerfile-next-distroless
+ build-args: |
+ VERSION=next
+ REVISION=${{ github.sha }}
+
+ - name: Build and push agent image (Distroless)
+ uses: depot/build-push-action@v1
+ with:
+ context: .
+ platforms: linux/amd64,linux/arm64,linux/arm/v7
+ push: true
+ tags: ${{ steps.image-names.outputs.agent }}:next-distroless
+ file: docker/next-builds/Dockerfile-agent-distroless
build-args: |
VERSION=next
REVISION=${{ github.sha }}
diff --git a/docker/next-builds/Dockerfile-agent-distroless b/docker/next-builds/Dockerfile-agent-distroless
new file mode 100644
index 000000000..350607014
--- /dev/null
+++ b/docker/next-builds/Dockerfile-agent-distroless
@@ -0,0 +1,33 @@
+FROM gcr.io/distroless/static-debian13
+
+ARG TARGETARCH
+ARG TARGETVARIANT
+ARG VERSION="dev"
+ARG REVISION="unknown"
+
+WORKDIR /app
+
+COPY ./backend/.bin/arcane-agent-linux-${TARGETARCH}${TARGETVARIANT} ./arcane-agent
+
+ENV ENVIRONMENT=production \
+ AGENT_MODE=true \
+ GIN_MODE=release \
+ PORT=3553
+
+LABEL org.opencontainers.image.authors="OFKM Technologies" \
+ org.opencontainers.image.url="https://github.com/getarcaneapp/arcane" \
+ org.opencontainers.image.documentation="https://github.com/getarcaneapp/arcane/blob/main/README.md" \
+ org.opencontainers.image.source="https://github.com/getarcaneapp/arcane" \
+ org.opencontainers.image.version=${VERSION} \
+ org.opencontainers.image.revision=${REVISION} \
+ org.opencontainers.image.licenses="BSD-3-Clause" \
+ org.opencontainers.image.ref.name="arcane-agent" \
+ org.opencontainers.image.title="Arcane Agent" \
+ org.opencontainers.image.description="Arcane Agent" \
+ com.getarcaneapp.arcane.updater="false" \
+ com.getarcaneapp.arcane.server="true"
+
+EXPOSE 3553
+VOLUME ["/app/data"]
+
+CMD ["./arcane-agent"]
\ No newline at end of file
diff --git a/docker/Dockerfile-agent-static b/docker/next-builds/Dockerfile-agent-static
similarity index 100%
rename from docker/Dockerfile-agent-static
rename to docker/next-builds/Dockerfile-agent-static
diff --git a/docker/next-builds/Dockerfile-next-distroless b/docker/next-builds/Dockerfile-next-distroless
new file mode 100644
index 000000000..f4f00b16d
--- /dev/null
+++ b/docker/next-builds/Dockerfile-next-distroless
@@ -0,0 +1,32 @@
+FROM gcr.io/distroless/static-debian13
+
+ARG TARGETARCH
+ARG TARGETVARIANT
+ARG VERSION="dev"
+ARG REVISION="unknown"
+
+WORKDIR /app
+
+COPY ./backend/.bin/arcane-linux-${TARGETARCH}${TARGETVARIANT} ./arcane
+
+ENV ENVIRONMENT=production
+ENV GIN_MODE=release
+ENV PORT=3552
+
+LABEL org.opencontainers.image.authors="OFKM Technologies" \
+ org.opencontainers.image.url="https://github.com/getarcaneapp/arcane" \
+ org.opencontainers.image.documentation="https://github.com/getarcaneapp/arcane/blob/main/README.md" \
+ org.opencontainers.image.source="https://github.com/getarcaneapp/arcane" \
+ org.opencontainers.image.version=${VERSION} \
+ org.opencontainers.image.revision=${REVISION} \
+ org.opencontainers.image.licenses="BSD-3-Clause" \
+ org.opencontainers.image.ref.name="arcane" \
+ org.opencontainers.image.title="Arcane" \
+ org.opencontainers.image.description="Modern Docker Management, Made for Everyone" \
+ com.getarcaneapp.arcane.updater="false" \
+ com.getarcaneapp.arcane.server="true"
+
+EXPOSE 3552
+VOLUME ["/app/data"]
+
+CMD ["./arcane"]
diff --git a/docker/Dockerfile-static b/docker/next-builds/Dockerfile-static
similarity index 100%
rename from docker/Dockerfile-static
rename to docker/next-builds/Dockerfile-static
diff --git a/scripts/github/build-binaries.sh b/scripts/github/build-binaries.sh
index c890b9a61..337f88814 100755
--- a/scripts/github/build-binaries.sh
+++ b/scripts/github/build-binaries.sh
@@ -64,15 +64,22 @@ build_platform() {
"$output_path" "$os" "$arch" "$cgo_enabled" "${BUILD_TAGS:+ tags=$BUILD_TAGS}"
fi
- local build_flags=()
- [ -n "$BUILD_TAGS" ] && build_flags=(-tags "$BUILD_TAGS")
-
- if [ -n "$arm_version" ]; then
- GOARM="$arm_version" CGO_ENABLED="$cgo_enabled" GOOS="$os" GOARCH="$arch" \
- go build "${build_flags[@]}" -ldflags="$LDFLAGS" -trimpath -o "$output_path" ./cmd/main.go
+ if [ -n "$BUILD_TAGS" ]; then
+ if [ -n "$arm_version" ]; then
+ GOARM="$arm_version" CGO_ENABLED="$cgo_enabled" GOOS="$os" GOARCH="$arch" \
+ go build -tags "$BUILD_TAGS" -ldflags="$LDFLAGS" -trimpath -o "$output_path" ./cmd/main.go
+ else
+ CGO_ENABLED="$cgo_enabled" GOOS="$os" GOARCH="$arch" \
+ go build -tags "$BUILD_TAGS" -ldflags="$LDFLAGS" -trimpath -o "$output_path" ./cmd/main.go
+ fi
else
- CGO_ENABLED="$cgo_enabled" GOOS="$os" GOARCH="$arch" \
- go build "${build_flags[@]}" -ldflags="$LDFLAGS" -trimpath -o "$output_path" ./cmd/main.go
+ if [ -n "$arm_version" ]; then
+ GOARM="$arm_version" CGO_ENABLED="$cgo_enabled" GOOS="$os" GOARCH="$arch" \
+ go build -ldflags="$LDFLAGS" -trimpath -o "$output_path" ./cmd/main.go
+ else
+ CGO_ENABLED="$cgo_enabled" GOOS="$os" GOARCH="$arch" \
+ go build -ldflags="$LDFLAGS" -trimpath -o "$output_path" ./cmd/main.go
+ fi
fi
echo "Done"
}