File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,10 @@ Thumbs.db
163163
164164# Logs
165165* .log
166+
167+ # Docker
168+ .docker /
169+ * .tar.gz
166170Makefile
167171test
168172test.dSYM /
Original file line number Diff line number Diff line change 1+ FROM alpine:3.23
2+
3+ # Install build dependencies
4+ RUN apk add --no-cache \
5+ gcc \
6+ musl-dev \
7+ make \
8+ autoconf \
9+ file
10+
11+ # Set working directory
12+ WORKDIR /build
13+
14+ # Copy source files
15+ COPY termcap.c termcap.h tparam.c version.c ./
16+ COPY configure configure.in Makefile.in ./
17+ COPY mkinstalldirs install-sh ./
18+
19+ # Run configure
20+ RUN ./configure
21+
22+ # Build static library with C23 support
23+ RUN make CFLAGS="-std=gnu23 -static -O2" libtermcap.a
24+
25+ # Create output directory
26+ RUN mkdir -p /output && cp libtermcap.a /output/
27+
28+ # Verify that libtermcap.a is a static library and contains no dynamic dependencies
29+ RUN file /output/libtermcap.a
30+ RUN nm -a /usr/local/lib/libtermcap.a | grep " U " && echo "ERROR: Found undefined symbols!" && exit 1 || echo "✓ No undefined symbols found"
31+
32+ # Final stage - minimal image with just the static library
33+ FROM alpine:3.23
34+ RUN mkdir -p /usr/local/lib
35+ COPY --from=0 /build/libtermcap.a /usr/local/lib/
36+ COPY --from=0 /build/termcap.h /usr/local/include/
37+
38+ # Verify the library was built
39+ RUN ls -lh /usr/local/lib/libtermcap.a
40+
41+ WORKDIR /workspace
You can’t perform that action at this time.
0 commit comments