-
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 (#…
…7748) # Description - Removed `make docker-test-image-build` and `make docker-test-image-push` because they were creating single arch builds. - Added **testrp** and **magpie** as part of multi arch builds: https://github.com/radius-project/radius/pull/7748/files#diff-267abdbaab3ee4a767a1905f07cb0033220b32d4a8c035502fe24dad37ee2e03R105-R106. - Added **testrp** and **magpie** as part of multi arch builds and pushes: https://github.com/radius-project/radius/pull/7748/files#diff-e5017862a52d1de76ba232f290f53785637620580359895b37c593f181afc6c1R115-R119. - Updated Dockerfiles for ucpd, applications-rp, and controller: - Removed unnecessary `TARGETPLATFORM:-linux/amd64` because that was throwing a warning stating that the TARGETPLATFORM is already `linux/amd64` by default if not provided. - Updated Dockerfiles for testrp and magpiego: - Made them more like the other Dockerfiles: ucpd, applications-rp, and controller. - Updated dependencies for magpiego (because I was there). - Reformatted a few files. ## Type of change Fixes: #7743 Signed-off-by: ytimocin <[email protected]>
- Loading branch information
Showing
11 changed files
with
213 additions
and
188 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"] |
Oops, something went wrong.