-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
25 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
FROM icr.io/codeengine/golang:latest AS stage | ||
|
||
WORKDIR /app/src | ||
|
||
FROM quay.io/projectquay/golang:1.22 AS build-env | ||
WORKDIR /go/src/app | ||
COPY . . | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux go build -o app . | ||
|
||
FROM icr.io/codeengine/alpine | ||
|
||
WORKDIR /app/src | ||
|
||
COPY --from=stage /app/src/app . | ||
RUN CGO_ENABLED=0 go build -o /go/bin/app . | ||
|
||
CMD [ "./app" ] | ||
# Copy the exe into a smaller base image | ||
FROM gcr.io/distroless/static-debian12 | ||
COPY --from=build-env /go/bin/app / | ||
CMD ["/app"] |
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,9 +1,14 @@ | ||
FROM icr.io/codeengine/node:18-alpine | ||
|
||
FROM registry.access.redhat.com/ubi9/nodejs-20:latest AS build-env | ||
WORKDIR /job | ||
|
||
COPY *.mjs *.json /job | ||
# Define which files should be copied into the container image | ||
COPY --chown=default:root *.mjs *.json . | ||
|
||
# Load all dependencies | ||
RUN npm install | ||
|
||
ENTRYPOINT [ "node", "job.mjs" ] | ||
# Use a small distroless image for as runtime image | ||
FROM gcr.io/distroless/nodejs20-debian12 | ||
COPY --from=build-env /job /job | ||
WORKDIR /job | ||
CMD ["job.mjs"] |
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