Skip to content

Commit 6771ca4

Browse files
authored
Merge pull request #8042 from jackfrancis/cas-release-automation
cluster autoscaler: enable automated builds for release
2 parents 55ce673 + 46acf7e commit 6771ca4

File tree

4 files changed

+17
-50
lines changed

4 files changed

+17
-50
lines changed

cluster-autoscaler/Dockerfile.amd64 renamed to cluster-autoscaler/Dockerfile

+14-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,20 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
ARG BASEIMAGE=gcr.io/distroless/static:nonroot-amd64
15-
FROM $BASEIMAGE
14+
FROM --platform=$BUILDPLATFORM golang:1.23 as builder
15+
16+
WORKDIR /workspace
17+
18+
COPY . .
19+
20+
ARG GOARCH
21+
ARG LDFLAGS_FLAG
22+
ARG TAGS_FLAG
23+
24+
RUN CGO_ENABLED=0 GOOS=linux go build -o cluster-autoscaler-$GOARCH $LDFLAGS_FLAG $TAGS_FLAG
25+
FROM gcr.io/distroless/static:nonroot
26+
ARG GOARCH
27+
COPY --from=builder /workspace/cluster-autoscaler-$GOARCH /cluster-autoscaler
1628

17-
COPY cluster-autoscaler-amd64 /cluster-autoscaler
1829
WORKDIR /
1930
CMD ["/cluster-autoscaler"]

cluster-autoscaler/Dockerfile.arm64

-19
This file was deleted.

cluster-autoscaler/Dockerfile.s390x

-19
This file was deleted.

cluster-autoscaler/Makefile

+3-9
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ else
2020
FOR_PROVIDER=
2121
endif
2222
ifdef LDFLAGS
23-
LDFLAGS_FLAG=--ldflags "${LDFLAGS}"
23+
LDFLAGS_FLAG=--ldflags="${LDFLAGS}"
2424
else
2525
LDFLAGS_FLAG=
2626
endif
@@ -64,15 +64,9 @@ dev-release-arch-%: build-arch-% make-image-arch-% push-image-arch-%
6464
make-image: make-image-arch-$(GOARCH)
6565

6666
make-image-arch-%:
67-
ifdef BASEIMAGE
68-
docker build --pull --build-arg BASEIMAGE=${BASEIMAGE} \
67+
GOOS=$(GOOS) GOARCH=$* docker buildx build --pull --platform linux/$* \
6968
-t ${IMAGE}-$*:${TAG} \
70-
-f Dockerfile.$* .
71-
else
72-
docker build --pull \
73-
-t ${IMAGE}-$*:${TAG} \
74-
-f Dockerfile.$* .
75-
endif
69+
-f Dockerfile .
7670
@echo "Image ${TAG}${FOR_PROVIDER}-$* completed"
7771

7872
push-image: push-image-arch-$(GOARCH)

0 commit comments

Comments
 (0)