-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1153 from equinor/master
Improve pipeline sync (#1152)
- Loading branch information
Showing
20 changed files
with
1,014 additions
and
267 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
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,30 +1,24 @@ | ||
FROM golang:1.22-alpine3.20 as base | ||
ENV GO111MODULE=on | ||
RUN apk update && \ | ||
apk add git ca-certificates curl && \ | ||
apk add --no-cache gcc musl-dev | ||
FROM --platform=$BUILDPLATFORM docker.io/golang:1.22.5-alpine3.20 AS builder | ||
ARG TARGETARCH | ||
ENV CGO_ENABLED=0 \ | ||
GOOS=linux \ | ||
GOARCH=${TARGETARCH} | ||
|
||
WORKDIR /go/src/github.com/equinor/radix-operator/ | ||
WORKDIR /src | ||
|
||
# Install project dependencies | ||
COPY go.mod go.sum ./ | ||
COPY ./go.mod ./go.sum ./ | ||
RUN go mod download | ||
# Copy project code | ||
COPY ./radix-operator ./radix-operator | ||
COPY ./pkg ./pkg | ||
WORKDIR /src/radix-operator | ||
RUN go build -ldflags="-s -w" -o /build/radix-operator | ||
|
||
# Final stage, ref https://github.com/GoogleContainerTools/distroless/blob/main/base/README.md for distroless | ||
FROM gcr.io/distroless/static | ||
WORKDIR /app | ||
COPY --from=builder /build/radix-operator . | ||
USER 1000 | ||
ENTRYPOINT ["/app/radix-operator"] | ||
|
||
FROM base as builder | ||
# Build | ||
WORKDIR /go/src/github.com/equinor/radix-operator/radix-operator/ | ||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -a -installsuffix cgo -o ./rootfs/radix-operator | ||
RUN addgroup -S -g 1000 radix-operator | ||
RUN adduser -S -u 1000 -G radix-operator radix-operator | ||
|
||
# Run operator | ||
FROM scratch | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /etc/passwd /etc/passwd | ||
COPY --from=builder /go/src/github.com/equinor/radix-operator/radix-operator/rootfs/radix-operator /usr/local/bin/radix-operator | ||
|
||
USER radix-operator | ||
ENTRYPOINT ["/usr/local/bin/radix-operator"] |
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,30 +1,21 @@ | ||
FROM golang:1.22-alpine3.20 as base | ||
FROM --platform=$BUILDPLATFORM docker.io/golang:1.22.5-alpine3.20 AS builder | ||
ARG TARGETARCH | ||
ENV CGO_ENABLED=0 \ | ||
GOOS=linux \ | ||
GOARCH=${TARGETARCH} | ||
|
||
RUN apk update && \ | ||
apk add ca-certificates curl git && \ | ||
apk add --no-cache gcc musl-dev | ||
WORKDIR /src | ||
|
||
WORKDIR /go/src/github.com/equinor/radix-operator/ | ||
|
||
# Install project dependencies | ||
COPY go.mod go.sum ./ | ||
COPY ./go.mod ./go.sum ./ | ||
RUN go mod download | ||
|
||
# Copy project code | ||
COPY ./pipeline-runner ./pipeline-runner | ||
COPY ./pkg ./pkg | ||
WORKDIR /src/pipeline-runner | ||
RUN go build -ldflags="-s -w" -o /build/pipeline-runner | ||
|
||
# Build | ||
FROM base as builder | ||
WORKDIR /go/src/github.com/equinor/radix-operator/pipeline-runner/ | ||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -a -installsuffix cgo -o ./rootfs/pipeline-runner | ||
RUN adduser -D -g '' radix-pipeline | ||
|
||
# Run operator | ||
FROM scratch | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /etc/passwd /etc/passwd | ||
COPY --from=builder /go/src/github.com/equinor/radix-operator/pipeline-runner/rootfs/pipeline-runner /usr/local/bin/pipeline-runner | ||
|
||
USER radix-pipeline | ||
ENTRYPOINT ["/usr/local/bin/pipeline-runner"] | ||
# Final stage, ref https://github.com/GoogleContainerTools/distroless/blob/main/base/README.md for distroless | ||
FROM gcr.io/distroless/static | ||
WORKDIR /app | ||
COPY --from=builder /build/pipeline-runner . | ||
USER 1000 | ||
ENTRYPOINT ["/app/pipeline-runner"] |
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
Oops, something went wrong.