Skip to content

Commit

Permalink
Merge pull request #100 from pi-hole/ftl-build/alpine-v3.21
Browse files Browse the repository at this point in the history
Update ftl-build container to Alpine v3.21
  • Loading branch information
DL6ER authored Dec 9, 2024
2 parents 5bb7a9c + 32f6004 commit 4ccbd54
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ftl-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG CONTAINER="alpine:latest"
ARG CONTAINER="alpine:3.21"
FROM ${CONTAINER} AS builder

ARG TARGETPLATFORM
Expand Down Expand Up @@ -45,9 +45,12 @@ RUN apk add --no-cache \
ENV STATIC true
ENV TEST true

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

# Ensure that the TERM environment variable is set
ENV TERM=${TERM:-xterm}

# Monkeypatch BATS to remove duplicate output of starting and finished test
# BATS uses ANSI escape codes to overwrite the line after the test has finished
# This is not supported by Github Actions as it does not provide a TTY to the docker build container
RUN sed -i '/buffer_with_truncation /d' /bats-core/libexec/bats-core/bats-format-pretty

# Test compile FTL's development branch, the result is removed from the final container
# Run the full test suite to ensure that the container is still capable of running the tests
RUN git clone https://github.com/pi-hole/FTL.git --branch "${GIT_BRANCH}" \
Expand Down

0 comments on commit 4ccbd54

Please sign in to comment.