Removed git dependency on make

This commit is contained in:
2026-04-17 03:16:27 +08:00
parent 8adf03a2a4
commit e138ec1254
6 changed files with 49 additions and 16 deletions

View File

@@ -54,7 +54,6 @@ https://docs.mono.si/gateway-development-kit/getting-started
Prerequisites Prerequisites
* make * make
* Docker * Docker
* git (cloning uboot repo because uboot does not provide direct downloads)
``` ```
make release make release

View File

@@ -3,13 +3,15 @@ DOCKER_IMAGE_ROOT=monok8s
# Image tag # Image tag
TAG=dev TAG=dev
# The Linux kernel, from NXP # NXP's Linux Factory
NXP_VERSION=lf-6.18.2-1.0.0 LINUX_FACTORY=6.18.2-1.0.0
FMLIB_VERSION=lf-6.18.2-1.0.0 NXP_VERSION=lf-$(LINUX_FACTORY)
FMC_VERSION=lf-6.18.2-1.0.0 FMLIB_VERSION=lf-$(LINUX_FACTORY)
DPDK_VERSION=lf-6.18.2-1.0.0 FMC_VERSION=lf-$(LINUX_FACTORY)
VPP_VERSION=lf-6.18.2-1.0.0 DPDK_VERSION=lf-$(LINUX_FACTORY)
VPP_VERSION=lf-$(LINUX_FACTORY)
VPP_UPSTREAM_VERSION=23.10 VPP_UPSTREAM_VERSION=23.10
MONO_ASK_VERSION=mt-$(LINUX_FACTORY)
CRIO_VERSION=cri-o.arm64.v1.35.2 CRIO_VERSION=cri-o.arm64.v1.35.2
KUBE_VERSION=v1.35.3 KUBE_VERSION=v1.35.3

View File

@@ -0,0 +1,26 @@
FROM alpine:3.23.0 AS base
# We seperate the packages so this line can be cached upstream
RUN apk add --no-cache curl ca-certificates
RUN apk add --no-cache git
# ---- uboot ----
FROM base AS uboot
ARG UBOOT_VERSION
WORKDIR /work
RUN apk add --no-cache git tar gzip
RUN git clone \
--depth 1 \
--branch "${UBOOT_VERSION}" \
--filter=blob:none \
https://github.com/u-boot/u-boot.git src
RUN mkdir -p /out && \
tar -C /work/src -zcf "/out/uboot-${UBOOT_VERSION}.tar.gz" .
# ---- final exported artifact set ----
FROM scratch
COPY --from=uboot /out/ /

View File

@@ -1,4 +1,4 @@
FROM alpine:3.22 AS build FROM alpine:3.23 AS build
RUN apk add --no-cache \ RUN apk add --no-cache \
build-base \ build-base \

View File

@@ -27,6 +27,8 @@ LOCAL_REGISTRY_PORT := 5000
CTL_BUILD_BASE_IMAGE := localhost:5000/monok8s/ctl-build-base:$(VERSION) CTL_BUILD_BASE_IMAGE := localhost:5000/monok8s/ctl-build-base:$(VERSION)
CTL_BINARY := ctl-linux-aarch64-$(VERSION) CTL_BINARY := ctl-linux-aarch64-$(VERSION)
DOWNLOAD_PACKAGES_STAMP := $(PACKAGES_DIR)/.download-packages.stamp
$(PACKAGES_DIR): $(PACKAGES_DIR):
mkdir -p $@ mkdir -p $@
@@ -78,15 +80,14 @@ ensure-registry:
fi; \ fi; \
fi fi
$(UBOOT_TAR): | $(PACKAGES_DIR) $(OUT_DIR) $(DOWNLOAD_PACKAGES_STAMP): docker/download-packages.Dockerfile makefile | $(PACKAGES_DIR)
rm -rf "$(OUT_DIR)/u-boot-$(UBOOT_VERSION)" docker build \
git clone --depth 1 --branch "$(UBOOT_VERSION)" --filter=blob:none \ -f docker/download-packages.Dockerfile \
https://github.com/u-boot/u-boot.git "$(OUT_DIR)/u-boot-$(UBOOT_VERSION)" --build-arg UBOOT_VERSION=$(UBOOT_VERSION) \
tar -C "$(OUT_DIR)/u-boot-$(UBOOT_VERSION)" -zcf "$@" . --output type=local,dest=./$(PACKAGES_DIR) .
rm -rf "$(OUT_DIR)/u-boot-$(UBOOT_VERSION)" @touch $@
test -f "$@"
uboot-tools: $(UBOOT_TAR) uboot-tools: $(DOWNLOAD_PACKAGES_STAMP)
docker buildx build --platform linux/arm64 \ docker buildx build --platform linux/arm64 \
-f docker/uboot-tools.Dockerfile \ -f docker/uboot-tools.Dockerfile \
--build-arg UBOOT_VERSION=$(UBOOT_VERSION) \ --build-arg UBOOT_VERSION=$(UBOOT_VERSION) \
@@ -152,6 +153,7 @@ clean:
dockerclean: dockerclean:
@echo "Removing tagged images..." @echo "Removing tagged images..."
- docker rmi \ - docker rmi \
localhost/monok8s/ctl-build-base:$(VERSION) \
localhost/monok8s/control-agent:$(VERSION) \ localhost/monok8s/control-agent:$(VERSION) \
localhost/monok8s/ctl-builder:$(VERSION) \ localhost/monok8s/ctl-builder:$(VERSION) \
localhost/monok8s/crdgen:$(VERSION) \ localhost/monok8s/crdgen:$(VERSION) \
@@ -161,6 +163,9 @@ dockerclean:
- docker image prune -f - docker image prune -f
- docker builder prune -f - docker builder prune -f
pkgclean:
rm -rf $(PACKAGES_DIR)
all: build build-agent build-local all: build build-agent build-local
.PHONY: \ .PHONY: \

View File

@@ -316,6 +316,7 @@ dockerclean:
- docker image prune -f - docker image prune -f
pkgclean: pkgclean:
$(MAKE) -C clitools pkgclean
rm -rf $(PACKAGES_DIR) rm -rf $(PACKAGES_DIR)
.PHONY: release kernel initramfs itb build-base clitools clean distclean pkgclean \ .PHONY: release kernel initramfs itb build-base clitools clean distclean pkgclean \