103 lines
4.8 KiB
Plaintext
103 lines
4.8 KiB
Plaintext
==========================================
|
|
Didactyl MUSL Static Binary Builder (PRODUCTION MODE)
|
|
==========================================
|
|
Project directory: /home/teknari/lt_gitea/didactyl
|
|
Output directory: /home/teknari/lt_gitea/didactyl
|
|
Debug build: false
|
|
|
|
✓ Docker is available and running
|
|
|
|
Building for platform: linux/amd64
|
|
Output binary: didactyl_static_x86_64
|
|
|
|
Checking for cached Alpine Docker image...
|
|
✓ Alpine 3.19 image found in cache
|
|
|
|
==========================================
|
|
Step 1: Building Alpine Docker image
|
|
==========================================
|
|
This will:
|
|
- Use Alpine Linux (native MUSL)
|
|
- Build all dependencies statically
|
|
- Compile didactyl with full static linking
|
|
|
|
#0 building with "default" instance using docker driver
|
|
|
|
#1 [internal] load build definition from Dockerfile.alpine-musl
|
|
#1 transferring dockerfile: 3.81kB done
|
|
#1 DONE 0.0s
|
|
|
|
#2 [internal] load metadata for docker.io/library/alpine:3.19
|
|
#2 DONE 0.0s
|
|
|
|
#3 [internal] load .dockerignore
|
|
#3 transferring context: 2B done
|
|
#3 DONE 0.0s
|
|
|
|
#4 [builder 1/10] FROM docker.io/library/alpine:3.19
|
|
#4 DONE 0.0s
|
|
|
|
#5 [internal] load build context
|
|
#5 transferring context: 10.34kB done
|
|
#5 DONE 0.0s
|
|
|
|
#6 [builder 9/10] RUN if [ "false" = "true" ]; then CFLAGS="-g -O2 -DDEBUG"; STRIP_CMD="echo 'Keeping debug symbols'"; echo "Building with DEBUG symbols enabled (optimized with -O2)"; else CFLAGS="-O2"; STRIP_CMD="strip /build/didactyl_static"; echo "Building optimized production binary (symbols stripped)"; fi && CURL_LIBS="$(pkg-config --static --libs libcurl)" && OPENSSL_LIBS="$(pkg-config --static --libs openssl)" && gcc -static $CFLAGS -Wall -Wextra -std=c99 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -I. -Isrc -Inostr_core_lib -Inostr_core_lib/nostr_core -Inostr_core_lib/cjson -Inostr_core_lib/nostr_websocket src/main.c src/config.c src/context.c src/llm.c src/nostr_handler.c src/agent.c src/tools.c src/debug.c -o /build/didactyl_static nostr_core_lib/libnostr_core_x64.a -lsecp256k1 $OPENSSL_LIBS $CURL_LIBS -lpthread -lm -ldl && eval "$STRIP_CMD"
|
|
#6 CACHED
|
|
|
|
#7 [builder 10/10] RUN echo "=== Binary Information ===" && file /build/didactyl_static && ls -lh /build/didactyl_static && echo "=== Checking for dynamic dependencies ===" && (ldd /build/didactyl_static 2>&1 || echo "Binary is static") && echo "=== Build complete ==="
|
|
#7 CACHED
|
|
|
|
#8 [builder 8/10] COPY Makefile /build/Makefile
|
|
#8 CACHED
|
|
|
|
#9 [builder 2/10] RUN apk add --no-cache build-base musl-dev git cmake pkgconfig autoconf automake libtool openssl-dev openssl-libs-static zlib-dev zlib-static curl-dev curl-static nghttp2-dev nghttp2-static c-ares-dev c-ares-static libpsl-dev libpsl-static libidn2-dev libidn2-static libunistring-dev libunistring-static brotli-dev brotli-static zstd-dev zstd-static sqlite-dev sqlite-static linux-headers wget bash
|
|
#9 CACHED
|
|
|
|
#10 [builder 3/10] WORKDIR /build
|
|
#10 CACHED
|
|
|
|
#11 [builder 4/10] RUN cd /tmp && git clone https://github.com/bitcoin-core/secp256k1.git && cd secp256k1 && ./autogen.sh && ./configure --enable-static --disable-shared --prefix=/usr CFLAGS="-fPIC" && make -j$(nproc) && make install && rm -rf /tmp/secp256k1
|
|
#11 CACHED
|
|
|
|
#12 [builder 7/10] COPY src/ /build/src/
|
|
#12 CACHED
|
|
|
|
#13 [builder 5/10] COPY nostr_core_lib /build/nostr_core_lib/
|
|
#13 CACHED
|
|
|
|
#14 [builder 6/10] RUN cd nostr_core_lib && chmod +x build.sh && sed -i 's/CFLAGS="-Wall -Wextra -std=c99 -fPIC -O2"/CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -Wall -Wextra -std=c99 -fPIC -O2"/' build.sh && rm -f *.o *.a 2>/dev/null || true && ./build.sh --nips=all
|
|
#14 CACHED
|
|
|
|
#15 [output 1/1] COPY --from=builder /build/didactyl_static /didactyl_static
|
|
#15 CACHED
|
|
|
|
#16 exporting to image
|
|
#16 exporting layers done
|
|
#16 writing image sha256:1e0a868f1e0957613b56504ecee24b1032f765254e070aad5725dd9af34df56a done
|
|
#16 naming to docker.io/library/didactyl-musl-builder:latest done
|
|
#16 DONE 0.0s
|
|
|
|
✓ Docker image built successfully
|
|
|
|
==========================================
|
|
Step 2: Extracting static binary
|
|
==========================================
|
|
✓ Binary extracted to: /home/teknari/lt_gitea/didactyl/didactyl_static_x86_64
|
|
|
|
==========================================
|
|
Step 3: Verifying static binary
|
|
==========================================
|
|
|
|
Checking for dynamic dependencies:
|
|
✓ Binary is statically linked (verified with file command)
|
|
|
|
==========================================
|
|
Build Summary
|
|
==========================================
|
|
Binary: /home/teknari/lt_gitea/didactyl/didactyl_static_x86_64
|
|
Size: 6.8M
|
|
Static: true
|
|
Debug: false
|
|
Platform: linux/amd64
|
|
==========================================
|