build updates

This commit is contained in:
Grant Limberg 2025-07-14 10:17:52 -07:00
parent 3fd42ad2a0
commit 8e5522647a
3 changed files with 11 additions and 9 deletions

View file

@ -1,12 +1,12 @@
# Dockerfile for ZeroTier Central Controllers
FROM registry.zerotier.com/zerotier/ctlbuild:2025-05-13-01 AS builder
FROM registry.zerotier.com/zerotier/ctlbuild:2025-07-14 AS builder
ADD . /ZeroTierOne
RUN export PATH=$PATH:~/.cargo/bin && cd ZeroTierOne && make clean && make central-controller -j8
FROM golang:bookworm AS go_base
RUN go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
FROM registry.zerotier.com/zerotier/ctlrun:2025-05-13-01
FROM registry.zerotier.com/zerotier/ctlrun:2025-07-14 AS run_base
COPY --from=builder /ZeroTierOne/zerotier-one /usr/local/bin/zerotier-one
COPY --from=go_base /go/bin/migrate /usr/local/bin/migrate
COPY ext/central-controller-docker/migrations /migrations

View file

@ -10,7 +10,7 @@ buildx:
@echo docker buildx inspect --bootstrap
controller-builder: buildx
docker buildx build --no-cache --platform linux/amd64,linux/arm64 -t $(registry)/ctlbuild:latest -f Dockerfile.builder . --push
docker buildx build --no-cache --platform linux/amd64,linux/arm64 -t $(registry)/ctlbuild:$(shell date +"%Y-%m-%d") -f Dockerfile.builder . --push
controller-runbase: buildx
docker buildx build --no-cache --platform linux/amd64,linux/arm64 -t $(registry)/ctlrun:latest -f Dockerfile.run_base . --push
docker buildx build --no-cache --platform linux/amd64,linux/arm64 -t $(registry)/ctlrun:$(shell date +"%Y-%m-%d") -f Dockerfile.run_base . --push

View file

@ -394,13 +394,13 @@ override LDFLAGS+=-Wl,-z,noexecstack
all: one
.PHONY: one
one: zerotier-one zerotier-idtool zerotier-cli
one: otel zerotier-one zerotier-idtool zerotier-cli
from_builder: FORCE
ln -sf zerotier-one zerotier-idtool
ln -sf zerotier-one zerotier-cli
zerotier-one: otel $(CORE_OBJS) $(ONE_OBJS) one.o
zerotier-one: $(CORE_OBJS) $(ONE_OBJS) one.o ext/${OTEL_INSTALL_DIR}/include/opentelemetry/version.h
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o zerotier-one $(CORE_OBJS) $(ONE_OBJS) one.o $(LDLIBS)
zerotier-idtool: zerotier-one
@ -431,12 +431,14 @@ doc: manpages
ifeq (${ZT_OTEL},1)
otel:
cd ext/opentelemetry-cpp-1.21.0 && mkdir -p localinstall && cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(shell pwd)/ext/opentelemetry-cpp-1.21.0/localinstall -DBUILD_TESTING=OFF -DOPENTELEMETRY_INSTALL=ON -DWITH_BENCHMARK=OFF -DWITH_EXAMPLES=OFF -DWITH_FUNC_TESTS=OFF -DUSE_THIRDPARTY_LIBRARIES=ON -DWITH_OTLP_GRPC=ON -DWITH_OTLP_HTTP=OFF -DWITH_PROMETHEUS=OFF
cd ext/opentelemetry-cpp-1.21.0/build && make install
cd ext/opentelemetry-cpp-1.21.0/build && make -j4 install
else
otel:
@echo "OpenTelemetry not enabled, skipping build."
@echo "OpenTelemetry exporter not enabled, skipping build."
endif
ext/${OTEL_INSTALL_DIR}/include/opentelemetry/version.h: otel
clean: FORCE
rm -rf *.a *.so *.o node/*.o controller/*.o osdep/*.o service/*.o ext/http-parser/*.o ext/miniupnpc/*.o ext/libnatpmp/*.o $(CORE_OBJS) $(ONE_OBJS) zerotier-one zerotier-idtool zerotier-cli zerotier-selftest build-* ZeroTierOneInstaller-* *.deb *.rpm .depend debian/files debian/zerotier-one*.debhelper debian/zerotier-one.substvars debian/*.log debian/zerotier-one doc/node_modules ext/misc/*.o debian/.debhelper debian/debhelper-build-stamp docker/zerotier-one rustybits/target ext/opentelemetry-cpp-${OTEL_VERSION}/localinstall ext/opentelemetry-cpp-${OTEL_VERSION}/build
@ -458,7 +460,7 @@ _buildx:
@echo docker buildx inspect --bootstrap
central-controller: FORCE
make -j4 ZT_CONTROLLER=1 ZT_OTEL=1 one
make ZT_OTEL=1 otel && make -j4 ZT_CONTROLLER=1 ZT_OTEL=1 one
central-controller-docker: _buildx FORCE
docker buildx build --platform linux/amd64,linux/arm64 --no-cache -t registry.zerotier.com/zerotier-central/ztcentral-controller:${TIMESTAMP} -f ext/central-controller-docker/Dockerfile --build-arg git_branch=`git name-rev --name-only HEAD` . --push