File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed
Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1111
1212# Downloaded at build time from fc-busybox release
1313pkg /template /build /core /systeminit /busybox
14- pkg /template /build /core /systeminit /busybox.version
14+ pkg /template /build /core /systeminit /busybox.stamp
Original file line number Diff line number Diff line change @@ -48,7 +48,10 @@ COPY ./orchestrator/Makefile ./orchestrator/Makefile
4848WORKDIR /build/orchestrator
4949
5050ARG COMMIT_SHA
51- RUN --mount=type=cache,target=/root/.cache/go-build make build-local COMMIT_SHA=${COMMIT_SHA}
51+ # Build directly (not via make build-local) to skip fetch-busybox — binary is already downloaded above.
52+ RUN --mount=type=cache,target=/root/.cache/go-build \
53+ CGO_ENABLED=1 GOOS=linux go build -o bin/orchestrator -ldflags "-X=main.commitSHA=${COMMIT_SHA}" . \
54+ && CGO_ENABLED=1 GOOS=linux go build -o bin/clean-nfs-cache -ldflags "-X=main.commitSHA=${COMMIT_SHA}" ./cmd/clean-nfs-cache
5255
5356FROM scratch
5457
Original file line number Diff line number Diff line change @@ -29,17 +29,19 @@ build:
2929
3030BUSYBOX_VERSION ?= 1.36.1
3131BUSYBOX_EMBED := pkg/template/build/core/systeminit/busybox
32- BUSYBOX_VERSION_FILE := $(BUSYBOX_EMBED ) .version
32+ BUSYBOX_STAMP := $(BUSYBOX_EMBED ) .stamp
3333
34+ # Download busybox if missing or version/arch changed. For Docker builds,
35+ # the Dockerfile downloads and verifies the binary separately — this target
36+ # is only used by build-local and build-debug (local dev / CI).
3437.PHONY : fetch-busybox
3538fetch-busybox :
36- @CURRENT=$$(cat $(BUSYBOX_VERSION_FILE ) 2>/dev/null || echo "" ) ; \
37- if [ ! -f $( BUSYBOX_EMBED) ] || [ " $$ CURRENT" != " $( BUSYBOX_VERSION) -$( BUILD_ARCH) " ]; then \
39+ @if [ ! -f $( BUSYBOX_EMBED) ] || [ " $$ (cat $( BUSYBOX_STAMP) 2>/dev/null)" != " $( BUSYBOX_VERSION) -$( BUILD_ARCH) " ]; then \
3840 echo " Downloading busybox v$( BUSYBOX_VERSION) ($( BUILD_ARCH) )..." ; \
3941 curl -sfL -o $(BUSYBOX_EMBED ) .tmp " https://github.com/e2b-dev/fc-busybox/releases/download/v$( BUSYBOX_VERSION) /busybox_v$( BUSYBOX_VERSION) _$( BUILD_ARCH) " \
4042 && mv $(BUSYBOX_EMBED ) .tmp $(BUSYBOX_EMBED ) \
4143 && chmod +x $(BUSYBOX_EMBED ) \
42- && echo " $( BUSYBOX_VERSION) -$( BUILD_ARCH) " > $(BUSYBOX_VERSION_FILE ) \
44+ && echo " $( BUSYBOX_VERSION) -$( BUILD_ARCH) " > $(BUSYBOX_STAMP ) \
4345 || { rm -f $( BUSYBOX_EMBED) .tmp; echo " ERROR: failed to download busybox" ; exit 1; }; \
4446 fi
4547
You can’t perform that action at this time.
0 commit comments