Skip to content

Commit

Permalink
dockerfile and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dbenque committed Jun 30, 2023
1 parent 25a8a96 commit 472338b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include: https://gitlab-templates.ddbuild.io/compute-delivery/v2/compute-delivery.yml

test:
stage: verify
tags: [ "arch:amd64" ]
image: registry.ddbuild.io/images/mirror/golang:1.20
script:
- echo "TODO test"

build-docker-image:
variables:
EXTRA_ARGS: "-f vertical-pod-autoscaler/Dockerfile"

extends: .build-docker-image

27 changes: 27 additions & 0 deletions vertical-pod-autoscaler/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ARG BASE_IMAGE

FROM --platform=$BUILDPLATFORM golang:1.19 AS builder
WORKDIR /go/src/k8s.io/autoscaler
COPY . .
ARG TARGETARCH
ENV GO111MODULE "on"
ENV GOARCH=${TARGETARCH}

WORKDIR /go/src/k8s.io/autoscaler/vertical-pod-autoscaler/pkg/recommender
RUN env CGO_ENABLED=0 GOARCH=${TARGETARCH} GOOS=linux go build -o vpa-recommender --ldflags "-s"

WORKDIR /go/src/k8s.io/autoscaler/vertical-pod-autoscaler/pkg/recommender-external
RUN env CGO_ENABLED=0 GOARCH=${TARGETARCH} GOOS=linux go build -o vpa-recommender-external-metrics --ldflags "-s"

WORKDIR /go/src/k8s.io/autoscaler/vertical-pod-autoscaler/pkg/admission-controller
RUN env CGO_ENABLED=0 GOARCH=${TARGETARCH} GOOS=linux go build -o vpa-admission-controller --ldflags "-s"

WORKDIR /go/src/k8s.io/autoscaler/vertical-pod-autoscaler/pkg/updater
RUN env CGO_ENABLED=0 GOARCH=${TARGETARCH} GOOS=linux go build -o vpa-updater --ldflags "-s"

FROM $BASE_IMAGE

COPY --from=builder /go/src/k8s.io/autoscaler/vertical-pod-autoscaler/pkg/recommender/vpa-recommender /usr/local/bin/vpa-recommender
COPY --from=builder /go/src/k8s.io/autoscaler/vertical-pod-autoscaler/pkg/recommender-external/vpa-recommender-external-metrics /usr/local/bin/vpa-recommender-external-metrics
COPY --from=builder /go/src/k8s.io/autoscaler/vertical-pod-autoscaler/pkg/admission-controller/vpa-admission-controller /usr/local/bin/vpa-admission-controller
COPY --from=builder /go/src/k8s.io/autoscaler/vertical-pod-autoscaler/pkg/updater/vpa-updater /usr/local/bin/vpa-updater

0 comments on commit 472338b

Please sign in to comment.