Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#2 from arjunrn/openshift-dockerfile
Browse files Browse the repository at this point in the history
Added Dockerfile used in Openshift builds
  • Loading branch information
openshift-merge-robot authored Feb 16, 2022
2 parents e81b17a + 36a4b05 commit 24948fd
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Dockerfile.openshift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# TODO: Switch to UBI golang image when 1.17 is released
# FROM registry.access.redhat.com/ubi8/go-toolset:latest AS builder
FROM golang:1.17 AS builder

WORKDIR /workspace

# Copy the dependencies which don't change frequently
COPY go.mod go.mod
COPY go.sum go.sum
COPY vendor vendor

# Copy the source files
COPY apis apis
COPY main.go main.go
COPY controllers controllers
COPY pkg pkg
COPY webhooks webhooks

# Build the controller
RUN go build -mod=vendor -o bin/controller main.go

FROM registry.access.redhat.com/ubi8/ubi-micro:latest
COPY --from=builder /workspace/bin/controller /usr/bin/controller
ENTRYPOINT ["/usr/bin/controller"]

0 comments on commit 24948fd

Please sign in to comment.