Skip to content

Commit 22b2663

Browse files
authored
Merge pull request openshift#6 from stolostron/konflux_build_changes
✨ Konflux build changes
2 parents 42618e4 + b69e87a commit 22b2663

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

stolostron/Dockerfile.stolostron

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM registry.access.redhat.com/ubi8/go-toolset:1.24.6-1755529056 AS toolchain
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+
7+
FROM toolchain AS builder
8+
9+
ENV GOPATH=/opt/app-root/src/go
10+
ENV GOFLAGS="-buildvcs=false"
11+
12+
COPY . .
13+
14+
# Cache deps before building and copying source so that we don't need to re-download as much
15+
# and so that source changes don't invalidate our downloaded layer
16+
RUN --mount=type=cache,target=/root/.local/share/golang \
17+
--mount=type=cache,target=/go/pkg/mod \
18+
go mod download
19+
20+
# Build
21+
ARG package=.
22+
RUN --mount=type=cache,target=/root/.cache/go-build \
23+
--mount=type=cache,target=/go/pkg/mod \
24+
--mount=type=cache,target=/root/.local/share/golang \
25+
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -ldflags "-extldflags '-static'" -o manager ${package}
26+
27+
# Copy the controller-manager into a thin image
28+
FROM registry.access.redhat.com/ubi9/ubi:9.6-1754380668
29+
COPY --from=builder /opt/app-root/src/manager /bin/cluster-api-provider-aws-controller-manager
30+
ENTRYPOINT ["/bin/cluster-api-provider-aws-controller-manager"]

stolostron/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
IMG_REG ?= registry.redhat.io
2+
IMG_REPO ?= multicluster
3+
IMG_NAME ?= cluster-api-provider-aws-rhel9
4+
IMG_TAG ?= latest
5+
IMG ?= ${IMG_REG}/${IMG_REPO}/${IMG_NAME}:${IMG_TAG}
6+
7+
docker-build:
8+
docker build -f Dockerfile.stolostron ../ -t ${IMG}

0 commit comments

Comments
 (0)