Skip to content

Commit

Permalink
Merge pull request #135 from equinor/remove_unneccessary_use_of_opera…
Browse files Browse the repository at this point in the history
…tor_func

fix multiplatform docker build performance
  • Loading branch information
nilsgstrabo authored Aug 16, 2024
2 parents 2030215 + 141ce00 commit 1fb30bb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
strategy:
fail-fast: false
matrix:
arch: [arm64]
target:
- name: "dev"
ref: "refs/heads/main"
Expand Down
19 changes: 3 additions & 16 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ jobs:
build:
name: pull-request-check
runs-on: ubuntu-20.04
strategy:
matrix:
arch: [arm64]
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
Expand All @@ -19,14 +16,13 @@ jobs:
with:
context: .
push: false
platforms: linux/arm64
platforms: |
linux/amd64
linux/arm64
test:
name: Unit Test
runs-on: ubuntu-latest
strategy:
matrix:
arch: [arm64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand All @@ -40,9 +36,6 @@ jobs:
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
arch: [arm64]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -58,9 +51,6 @@ jobs:
verify-code-generation:
name: Verify Code Generation
runs-on: ubuntu-latest
strategy:
matrix:
arch: [arm64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand All @@ -73,9 +63,6 @@ jobs:
report-swagger-changes:
name: Report Changes In Swagger Spec
runs-on: ubuntu-latest
strategy:
matrix:
arch: [arm64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down
12 changes: 4 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
FROM docker.io/golang:1.22-alpine3.20 AS builder

FROM --platform=$BUILDPLATFORM docker.io/golang:1.22-alpine3.20 AS builder
ARG TARGETARCH
ENV CGO_ENABLED=0 \
GOOS=linux
GOOS=linux \
GOARCH=${TARGETARCH}

WORKDIR /src

# Install project dependencies
COPY go.mod go.sum ./
RUN go mod download

# Copy project code
COPY . .

RUN go build -ldflags="-s -w" -o /build/radix-job-scheduler

# 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-job-scheduler .

USER 1000
ENTRYPOINT ["/app/radix-job-scheduler"]

0 comments on commit 1fb30bb

Please sign in to comment.