Skip to content

Commit 4ccbd54

Browse files
authored
Merge pull request #100 from pi-hole/ftl-build/alpine-v3.21
Update ftl-build container to Alpine v3.21
2 parents 5bb7a9c + 32f6004 commit 4ccbd54

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ftl-build/Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG CONTAINER="alpine:latest"
1+
ARG CONTAINER="alpine:3.21"
22
FROM ${CONTAINER} AS builder
33

44
ARG TARGETPLATFORM
@@ -45,9 +45,12 @@ RUN apk add --no-cache \
4545
ENV STATIC true
4646
ENV TEST true
4747

48+
# As of Alpine 3.21 (Dec 2024), we need to patch the termcap library to include
49+
# the standard headers as well as unistd.h for the write function
4850
RUN curl -sSL https://ftl.pi-hole.net/libraries/termcap-${termcapversion}.tar.gz | tar -xz \
4951
&& cd termcap-${termcapversion} \
5052
&& ./configure --enable-static --disable-shared --disable-doc --without-examples \
53+
&& sed -i '1i #define STDC_HEADERS 1\n#include <unistd.h>' termcap.c tparam.c \
5154
&& make -j $(nproc) \
5255
&& make install \
5356
&& ls /usr/local/lib/ \
@@ -109,6 +112,14 @@ ARG CI_ARCH="$TARGETPLATFORM"
109112
ARG GIT_TAG="test-build"
110113
ARG GIT_BRANCH="special/CI_development"
111114

115+
# Ensure that the TERM environment variable is set
116+
ENV TERM=${TERM:-xterm}
117+
118+
# Monkeypatch BATS to remove duplicate output of starting and finished test
119+
# BATS uses ANSI escape codes to overwrite the line after the test has finished
120+
# This is not supported by Github Actions as it does not provide a TTY to the docker build container
121+
RUN sed -i '/buffer_with_truncation /d' /bats-core/libexec/bats-core/bats-format-pretty
122+
112123
# Test compile FTL's development branch, the result is removed from the final container
113124
# Run the full test suite to ensure that the container is still capable of running the tests
114125
RUN git clone https://github.com/pi-hole/FTL.git --branch "${GIT_BRANCH}" \

0 commit comments

Comments
 (0)