-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding multi arch container image generation for magpie and testrp
Signed-off-by: ytimocin <[email protected]>
- Loading branch information
Showing
11 changed files
with
209 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
# Note: Using Alpine image to enable Git installation for Terraform module downloads. | ||
# Use Alpine image to enable Git installation for Terraform module downloads. | ||
# Switch to distroless when Terraform execution is moved to a separate container. | ||
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.18 | ||
FROM alpine:3.20 | ||
|
||
ARG TARGETPLATFORM | ||
ARG TARGETARCH | ||
|
||
# Install ca-certificates and Git (required for Terraform module downloads) | ||
RUN apk --no-cache add ca-certificates git | ||
|
||
# Create non-root user | ||
RUN addgroup -g 65532 rpuser && \ | ||
# Create non-root user in a single RUN command to minimize layers | ||
RUN apk --no-cache add ca-certificates git && \ | ||
addgroup -g 65532 rpuser && \ | ||
adduser -u 65532 -G rpuser -s /bin/sh -D rpuser | ||
|
||
WORKDIR / | ||
|
||
# Copy the application binary | ||
COPY ./linux_${TARGETARCH:-amd64}/release/applications-rp / | ||
|
||
# Set the user to non-root | ||
USER rpuser | ||
|
||
# Expose the application port | ||
EXPOSE 8080 | ||
|
||
# Set the entrypoint to the application binary | ||
ENTRYPOINT ["/applications-rp"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
# Note: distroless already includes ca-certificates | ||
FROM --platform=${TARGETPLATFORM:-linux/amd64} gcr.io/distroless/static:nonroot | ||
# Use distroless image which already includes ca-certificates | ||
FROM gcr.io/distroless/static:nonroot | ||
|
||
ARG TARGETPLATFORM | ||
# Argument for target architecture | ||
ARG TARGETARCH | ||
|
||
# Set the working directory | ||
WORKDIR / | ||
|
||
# Copy the application binary for the specified architecture | ||
COPY ./linux_${TARGETARCH:-amd64}/release/controller / | ||
|
||
# Set the user to non-root (65532:65532 is the default non-root user in distroless) | ||
USER 65532:65532 | ||
|
||
# Set the entrypoint to the application binary | ||
ENTRYPOINT ["/controller"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
# Note: distroless already includes ca-certificates | ||
FROM --platform=${TARGETPLATFORM:-linux/amd64} gcr.io/distroless/static:nonroot | ||
# Use distroless image which already includes ca-certificates | ||
FROM gcr.io/distroless/static:nonroot | ||
|
||
ARG TARGETPLATFORM | ||
# Argument for target architecture | ||
ARG TARGETARCH | ||
|
||
# Set the working directory | ||
WORKDIR / | ||
|
||
# Copy the application binary for the specified architecture | ||
COPY ./linux_${TARGETARCH:-amd64}/release/ucpd / | ||
|
||
# Set the user to non-root (65532:65532 is the default non-root user in distroless) | ||
USER 65532:65532 | ||
|
||
# Set the entrypoint to the application binary | ||
ENTRYPOINT ["/ucpd"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.