build auto-pause outside kicbase dockerfile

pull/14337/head
Sharif Elgamal 2022-06-13 17:08:30 -07:00
parent 0250e06b73
commit 7d74925578
2 changed files with 5 additions and 3 deletions

View File

@ -739,7 +739,8 @@ endif
ifndef CIBUILD
$(call user_confirm, 'Are you sure you want to push $(KICBASE_IMAGE_REGISTRIES) ?')
endif
env $(X_BUILD_ENV) docker buildx build -f ./deploy/kicbase/Dockerfile --builder $(X_DOCKER_BUILDER) --platform $(KICBASE_ARCH) $(addprefix -t ,$(KICBASE_IMAGE_REGISTRIES)) --push --build-arg COMMIT_SHA=${VERSION}-$(COMMIT) .
./deploy/kicbase/build_auto_pause.sh $(KICBASE_ARCH)
env $(X_BUILD_ENV) docker buildx build -f ./deploy/kicbase/Dockerfile --builder $(X_DOCKER_BUILDER) --platform $(KICBASE_ARCH) $(addprefix -t ,$(KICBASE_IMAGE_REGISTRIES)) --push --build-arg COMMIT_SHA=${VERSION}-$(COMMIT) --build-arg PREBUILT_AUTO_PAUSE=true .
out/preload-tool:
go build -ldflags="$(MINIKUBE_LDFLAGS)" -o $@ ./hack/preload-images/*.go

View File

@ -31,7 +31,8 @@ COPY third_party/ ./third_party
COPY go.mod go.sum ./
ARG TARGETARCH
ENV GOARCH=${TARGETARCH}
RUN cd ./cmd/auto-pause/ && go build
ARG PREBUILT_AUTO_PAUSE
RUN if [ "$PREBUILT_AUTO_PAUSE" != "true" ]; then cd ./cmd/auto-pause/ && go build -o auto-pause-${TARGETARCH}; fi
# start from ubuntu 20.04, this image is reasonably small as a starting point
# for a kubernetes node image, it doesn't contain much we don't need
@ -51,7 +52,7 @@ COPY deploy/kicbase/02-crio.conf /etc/crio/crio.conf.d/02-crio.conf
COPY deploy/kicbase/containerd.toml /etc/containerd/config.toml
COPY deploy/kicbase/clean-install /usr/local/bin/clean-install
COPY deploy/kicbase/entrypoint /usr/local/bin/entrypoint
COPY --from=auto-pause /src/cmd/auto-pause/auto-pause /bin/auto-pause
COPY --from=auto-pause /src/cmd/auto-pause/auto-pause-${TARGETARCH} /bin/auto-pause
# Install dependencies, first from apt, then from release tarballs.