File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 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"]
Original file line number Diff line number Diff line change 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}
You can’t perform that action at this time.
0 commit comments