Skip to content

Commit

Permalink
upgrade to go 1.16 (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
maskarb authored Dec 15, 2021
1 parent 71f861b commit 02f315a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# Build the manager binary
FROM gcr.io/gcp-runtimes/go1-builder:1.15 as builder
FROM registry.access.redhat.com/ubi8/ubi:latest as builder

RUN INSTALL_PKGS="go-toolset git" && \
yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum clean all -y

WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we do not need to re-download as much
# and so that source changes do not invalidate our downloaded layer
RUN /usr/local/go/bin/go mod download
RUN go mod download

# Copy the go source
COPY main.go main.go
Expand All @@ -28,7 +33,7 @@ COPY .git .git
RUN GIT_COMMIT=$(git rev-list -1 HEAD) && \
echo " injecting GIT COMMIT: $GIT_COMMIT" && \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on \
/usr/local/go/bin/go build -ldflags "-X github.com/project-koku/koku-metrics-operator/controllers.GitCommit=$GIT_COMMIT" -a -o manager main.go
go build -ldflags "-w -s -X github.com/project-koku/koku-metrics-operator/controllers.GitCommit=$GIT_COMMIT" -a -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down

0 comments on commit 02f315a

Please sign in to comment.