File tree Expand file tree Collapse file tree 4 files changed +20
-5
lines changed Expand file tree Collapse file tree 4 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ RELEASE_REGISTRY?=gcr.io/k8s-staging-scheduler-plugins
24
24
RELEASE_VERSION? =v$(shell date +% Y% m% d) -$(shell git describe --tags --match "v* ")
25
25
RELEASE_IMAGE: =kube-scheduler:$(RELEASE_VERSION )
26
26
RELEASE_CONTROLLER_IMAGE: =controller:$(RELEASE_VERSION )
27
+ GO_BASE_IMAGE? =golang
27
28
28
29
# VERSION is the scheduler's version
29
30
#
@@ -80,6 +81,8 @@ release-image.amd64: clean
80
81
REGISTRY=$(RELEASE_REGISTRY ) \
81
82
IMAGE=$(RELEASE_IMAGE ) -amd64 \
82
83
CONTROLLER_IMAGE=$(RELEASE_CONTROLLER_IMAGE ) -amd64 \
84
+ GO_BASE_IMAGE=$(GO_BASE_IMAGE ) \
85
+ ALPINE_BASE_IMAGE=$(ALPINE_BASE_IMAGE ) \
83
86
hack/build-images.sh
84
87
85
88
.PHONY : release-image.arm64v8
@@ -89,6 +92,8 @@ release-image.arm64v8: clean
89
92
REGISTRY=$(RELEASE_REGISTRY ) \
90
93
IMAGE=$(RELEASE_IMAGE ) -arm64 \
91
94
CONTROLLER_IMAGE=$(RELEASE_CONTROLLER_IMAGE ) -arm64 \
95
+ GO_BASE_IMAGE=$(GO_BASE_IMAGE ) \
96
+ ALPINE_BASE_IMAGE=$(ALPINE_BASE_IMAGE ) \
92
97
hack/build-images.sh
93
98
94
99
.PHONY : push-release-images
Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
ARG ARCH
15
- FROM golang:1.20
15
+ ARG GO_BASE_IMAGE=golang
16
+ ARG ALPINE_BASE_IMAGE=$ARCH/alpine
17
+ FROM $GO_BASE_IMAGE:1.21
16
18
17
19
WORKDIR /go/src/sigs.k8s.io/scheduler-plugins
18
20
COPY . .
19
21
ARG ARCH
20
22
RUN make build-controller.$ARCH
21
23
22
- FROM $ARCH/alpine :3.16
24
+ FROM $ALPINE_BASE_IMAGE :3.16
23
25
24
26
COPY --from=0 /go/src/sigs.k8s.io/scheduler-plugins/bin/controller /bin/controller
25
27
Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
ARG ARCH
15
- FROM golang:1.20
15
+ ARG GO_BASE_IMAGE=golang
16
+ ARG ALPINE_BASE_IMAGE=$ARCH/alpine
17
+ FROM $GO_BASE_IMAGE:1.21
16
18
17
19
WORKDIR /go/src/sigs.k8s.io/scheduler-plugins
18
20
COPY . .
19
21
ARG ARCH
20
22
ARG RELEASE_VERSION
21
23
RUN RELEASE_VERSION=${RELEASE_VERSION} make build-scheduler.$ARCH
22
24
23
- FROM $ARCH/alpine :3.16
25
+ FROM $ALPINE_BASE_IMAGE :3.16
24
26
25
27
COPY --from=0 /go/src/sigs.k8s.io/scheduler-plugins/bin/kube-scheduler /bin/kube-scheduler
26
28
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ CONTROLLER_DIR="${SCRIPT_ROOT}"/build/controller
26
26
REGISTRY=${REGISTRY:- " localhost:5000/scheduler-plugins" }
27
27
IMAGE=${IMAGE:- " kube-scheduler:latest" }
28
28
CONTROLLER_IMAGE=${CONTROLLER_IMAGE:- " controller:latest" }
29
-
30
29
RELEASE_VERSION=${RELEASE_VERSION:- " v0.0.0" }
31
30
32
31
BUILDER=${BUILDER:- " docker" }
@@ -40,15 +39,22 @@ if [[ "${ARCH}" == "arm64" ]]; then
40
39
ARCH=" arm64v8"
41
40
fi
42
41
42
+ GO_BASE_IMAGE=${GO_BASE_IMAGE:- " golang" }
43
+ ALPINE_BASE_IMAGE=${ALPINE_BASE_IMAGE:- " $ARCH /alpine" }
44
+
43
45
cd " ${SCRIPT_ROOT} "
44
46
45
47
${BUILDER} build \
46
48
-f ${SCHEDULER_DIR} /Dockerfile \
47
49
--build-arg ARCH=${ARCH} \
48
50
--build-arg RELEASE_VERSION=${RELEASE_VERSION} \
51
+ --build-arg GO_BASE_IMAGE=${GO_BASE_IMAGE} \
52
+ --build-arg ALPINE_BASE_IMAGE=${ALPINE_BASE_IMAGE} \
49
53
-t ${REGISTRY} /${IMAGE} .
50
54
${BUILDER} build \
51
55
-f ${CONTROLLER_DIR} /Dockerfile \
52
56
--build-arg ARCH=${ARCH} \
53
57
--build-arg RELEASE_VERSION=${RELEASE_VERSION} \
58
+ --build-arg GO_BASE_IMAGE=${GO_BASE_IMAGE} \
59
+ --build-arg ALPINE_BASE_IMAGE=${ALPINE_BASE_IMAGE} \
54
60
-t ${REGISTRY} /${CONTROLLER_IMAGE} .
You can’t perform that action at this time.
0 commit comments