Skip to content

Commit

Permalink
Dockerfile: Build with Go 1.19
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
  • Loading branch information
stefanprodan committed Sep 27, 2022
1 parent c4468f2 commit 411c319
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
ARG GO_VERSION=1.19
ARG XX_VERSION=1.1.0

FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx

# Build the manager binary
FROM --platform=$BUILDPLATFORM golang:1.18-alpine AS builder
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine as builder

# Copy the build utilities.
COPY --from=xx / /

ARG TARGETPLATFORM

# Configure workspace.
WORKDIR /workspace

# copy api submodule
COPY api/ api/

# copy modules manifests
COPY go.mod go.mod
COPY go.sum go.sum

# Copy this, which should not change often; and, needs to be in place
# before `go mod download`.
COPY api/ api/

# cache modules
RUN go mod download

Expand All @@ -29,7 +27,7 @@ COPY main.go main.go
COPY controllers/ controllers/
COPY internal/ internal/

# build without giving the arch, so that it gets it from the machine
# build
ENV CGO_ENABLED=0
RUN xx-go build -a -o image-reflector-controller main.go

Expand Down

0 comments on commit 411c319

Please sign in to comment.