Skip to content

Commit 9a971a7

Browse files
Merge pull request #62 from rokej/konflux_enablement
Create Dockerfile.rhtap
2 parents 0d5c8e7 + 9b50307 commit 9a971a7

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Dockerfile.rhtap

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.22 as builder
2+
3+
# Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy
4+
ARG goproxy=https://proxy.golang.org
5+
ENV GOPROXY=$goproxy
6+
ENV GOFLAGS="-mod=readonly"
7+
8+
WORKDIR /workspace
9+
10+
# Copy the sources
11+
COPY ./ ./
12+
RUN go mod download
13+
14+
# Build
15+
ARG package=.
16+
ARG ARCH
17+
ARG LDFLAGS
18+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -ldflags "${LDFLAGS} -extldflags '-static'" -o manager ${package}
19+
20+
# Copy the controller-manager into a thin image
21+
FROM registry.redhat.io/rhel9-4-els/rhel:9.4
22+
WORKDIR /
23+
COPY --from=builder /workspace/manager .
24+
# Use uid of nonroot user (65532) because kubernetes expects numeric user when applying pod security policies
25+
USER 65532
26+
ENTRYPOINT ["/manager"]

0 commit comments

Comments
 (0)