Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ftl-build container improvements #31

Merged
merged 3 commits into from
Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/image-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- ftl-build_armv5te
- ftl-build_armv6hf
- ftl-build_armv7hf
- ftl-build_armv8a
- ftl-build_x86_32
- ftl-build_x86_64
- ftl-build_x86_64-musl
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ services:
build:
context: ftl-build/armv7hf

ftl-build_armv8a:
image: pihole/ftl-build:armv8a
build:
context: ftl-build/armv8a

ftl-build_x86_32:
image: pihole/ftl-build:x86_32
build:
Expand Down
19 changes: 15 additions & 4 deletions ftl-build/aarch64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
FROM debian:stretch
FROM debian:buster

# For FTL test compilation
ARG CIRCLE_JOB="aarch64"
ARG CIRCLE_TAG="test-build"
ARG BRANCH="special/CI_development"

# ghr 0.13.0 2019-09-16
ARG ghrversion=0.13.0
Expand Down Expand Up @@ -55,6 +60,12 @@ RUN curl -sSL https://ftl.pi-hole.net/libraries/readline-${readlineversion}.tar.
&& cd .. \
&& rm -r readline-${readlineversion}

# Uncomment the following line to test-compile FTL master during docker container development
#RUN git clone https://github.com/pi-hole/FTL.git && cd FTL && git checkout development \
# && bash build.sh -DLUA_READLINE=true && readelf -A ./pihole-FTL
# Test compile FTL's development branch, the result is removed from the final container
# We accept errors in the test step to be able to update the arch_tests if a change is intended
RUN git clone https://github.com/pi-hole/FTL.git \
&& cd FTL \
&& git checkout "${BRANCH}" \
&& bash .circleci/build-CI.sh "${STATIC}" "${BRANCH}" "${CIRCLE_TAG}" "${CIRCLE_JOB}" \
&& bash test/arch_test.sh \
&& cd .. \
&& rm -r FTL
25 changes: 22 additions & 3 deletions ftl-build/armv4t/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Note that this has to stay at stretch as buster removed ARMv4T compliance
FROM debian:stretch

# For FTL test compilation
ARG CIRCLE_JOB="armv4t"
ARG CIRCLE_TAG="test-build"
ARG BRANCH="special/CI_development"

# ghr 0.13.0 2019-09-16
ARG ghrversion=0.13.0

ARG idnversion=1.36
ARG readlineversion=8.0
ARG termcapversion=1.3.1

Expand Down Expand Up @@ -39,6 +45,13 @@ RUN curl -sSL https://github.com/tcnksm/ghr/releases/download/v${ghrversion}/ghr
ENV CC "arm-linux-gnueabi-gcc -isystem /usr/local/include"
RUN ln -s /usr/arm-linux-gnueabi/lib/libm.so /usr/local/lib/

RUN curl -sSL https://ftl.pi-hole.net/libraries/libidn-${idnversion}.tar.gz | tar -xz \
&& cd libidn-${idnversion} \
&& ./configure --host=armv6-linux-gnueabi --enable-static --disable-shared --disable-doc --without-examples \
&& make -j $(nproc) install \
&& cd .. \
&& rm -r libidn-${idnversion}

RUN curl -sSL https://ftl.pi-hole.net/libraries/termcap-${termcapversion}.tar.gz | tar -xz \
&& cd termcap-${termcapversion} \
&& ./configure --host=arm-linux-gnueabi --enable-static --disable-shared --disable-doc --without-examples \
Expand All @@ -57,6 +70,12 @@ RUN curl -sSL https://ftl.pi-hole.net/libraries/readline-${readlineversion}.tar.
&& cd .. \
&& rm -r readline-${readlineversion}

# Uncomment the following line to test-compile FTL master during docker container development
# RUN git clone https://github.com/pi-hole/FTL.git && cd FTL && git checkout development \
# && bash build.sh -DLUA_READLINE=true && readelf -A ./pihole-FTL
# Test compile FTL's development branch, the result is removed from the final container
# We accept errors in the test step to be able to update the arch_tests if a change is intended
RUN git clone https://github.com/pi-hole/FTL.git \
&& cd FTL \
&& git checkout "${BRANCH}" \
&& bash .circleci/build-CI.sh "${STATIC}" "${BRANCH}" "${CIRCLE_TAG}" "${CIRCLE_JOB}" \
&& bash test/arch_test.sh \
&& cd .. \
&& rm -r FTL
26 changes: 22 additions & 4 deletions ftl-build/armv5te/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
FROM debian:buster

# For FTL test compilation
ARG CIRCLE_JOB="armv5te"
ARG CIRCLE_TAG="test-build"
ARG BRANCH="special/CI_development"

# ghr 0.13.0 2019-09-16
ARG ghrversion=0.13.0

ARG idnversion=1.36
ARG readlineversion=8.0
ARG termcapversion=1.3.1

Expand All @@ -18,7 +24,6 @@ RUN dpkg --add-architecture armel \
libc6-dev-armel-cross \
libcap-dev:armel \
libcap2-bin \
libidn11-dev:armel \
make \
netcat-traditional \
nettle-dev:armel \
Expand All @@ -38,6 +43,13 @@ RUN curl -sSL https://github.com/tcnksm/ghr/releases/download/v${ghrversion}/ghr
ENV CC "arm-linux-gnueabi-gcc -isystem /usr/local/include"
RUN ln -s /usr/arm-linux-gnueabi/lib/libm.so /usr/local/lib/

RUN curl -sSL https://ftl.pi-hole.net/libraries/libidn-${idnversion}.tar.gz | tar -xz \
&& cd libidn-${idnversion} \
&& ./configure --host=armv6-linux-gnueabi --enable-static --disable-shared --disable-doc --without-examples \
&& make -j $(nproc) install \
&& cd .. \
&& rm -r libidn-${idnversion}

RUN curl -sSL https://ftl.pi-hole.net/libraries/termcap-${termcapversion}.tar.gz | tar -xz \
&& cd termcap-${termcapversion} \
&& ./configure --host=arm-linux-gnueabi --enable-static --disable-shared --disable-doc --without-examples \
Expand All @@ -56,6 +68,12 @@ RUN curl -sSL https://ftl.pi-hole.net/libraries/readline-${readlineversion}.tar.
&& cd .. \
&& rm -r readline-${readlineversion}

# Uncomment the following line to test-compile FTL master during docker container development
# RUN git clone https://github.com/pi-hole/FTL.git && cd FTL && git checkout development \
# && bash build.sh -DLUA_READLINE=true && readelf -A ./pihole-FTL
# Test compile FTL's development branch, the result is removed from the final container
# We accept errors in the test step to be able to update the arch_tests if a change is intended
RUN git clone https://github.com/pi-hole/FTL.git \
&& cd FTL \
&& git checkout "${BRANCH}" \
&& bash .circleci/build-CI.sh "${STATIC}" "${BRANCH}" "${CIRCLE_TAG}" "${CIRCLE_JOB}" \
&& bash test/arch_test.sh \
&& cd .. \
&& rm -r FTL
32 changes: 23 additions & 9 deletions ftl-build/armv6hf/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
FROM debian:buster
# We cannot use stretch here due to libc-incompatibilities (undefined reference to `fcntl64')
FROM debian:stretch

# For FTL test compilation
ARG CIRCLE_JOB="armv6hf"
ARG CIRCLE_TAG="test-build"
ARG BRANCH="special/CI_development"

# ghr 0.13.0 2019-09-16
ARG ghrversion=0.13.0

ARG idnversion=1.36
ARG readlineversion=8.0
ARG termcapversion=1.3.1

Expand Down Expand Up @@ -54,11 +61,12 @@ RUN wget ftl.pi-hole.net/libraries/libgmp.a -O /usr/local/lib/libgmp.a && \
ENV CC "arm-linux-gnueabihf-gcc -isystem /usr/include -isystem /usr/include/arm-linux-gnueabi -isystem /usr/local/include -L/usr/local/lib"
RUN ln -s /usr/arm-linux-gnueabihf/sysroot/usr/lib/libm.so /usr/local/lib/

# Download and cross-compile libidn, we prevent the examples from being built as they will not
# run on the x86_64 host and lead to errors
RUN curl -sSL https://ftp.gnu.org/gnu/libidn/libidn-1.35.tar.gz | tar -xz && \
cd libidn-1.35 && ./configure --host=armv6-linux-gnueabi --disable-shared --disable-doc --without-examples && \
make -j $(nproc) install
RUN curl -sSL https://ftl.pi-hole.net/libraries/libidn-${idnversion}.tar.gz | tar -xz \
&& cd libidn-${idnversion} \
&& ./configure --host=armv6-linux-gnueabi --enable-static --disable-shared --disable-doc --without-examples \
&& make -j $(nproc) install \
&& cd .. \
&& rm -r libidn-${idnversion}

RUN curl -sSL https://ftl.pi-hole.net/libraries/termcap-${termcapversion}.tar.gz | tar -xz \
&& cd termcap-${termcapversion} \
Expand All @@ -78,6 +86,12 @@ RUN curl -sSL https://ftl.pi-hole.net/libraries/readline-${readlineversion}.tar.
&& cd .. \
&& rm -r readline-${readlineversion}

# Uncomment the following line to test-compile FTL master during docker container development
# RUN git clone https://github.com/pi-hole/FTL.git && cd FTL && git checkout development \
# && bash build.sh -DLUA_READLINE=true && readelf -A ./pihole-FTL
# Test compile FTL's development branch, the result is removed from the final container
# We accept errors in the test step to be able to update the arch_tests if a change is intended
RUN git clone https://github.com/pi-hole/FTL.git \
&& cd FTL \
&& git checkout "${BRANCH}" \
&& bash .circleci/build-CI.sh "${STATIC}" "${BRANCH}" "${CIRCLE_TAG}" "${CIRCLE_JOB}" \
&& bash test/arch_test.sh \
&& cd .. \
&& rm -r FTL
30 changes: 24 additions & 6 deletions ftl-build/armv7hf/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
FROM debian:buster

# For FTL test compilation
ARG CIRCLE_JOB="armv7hf"
ARG CIRCLE_TAG="test-build"
ARG BRANCH="special/CI_development"

# ghr 0.13.0 2019-09-16
ARG ghrversion=0.13.0

ARG idnversion=1.36
ARG readlineversion=8.0
ARG termcapversion=1.3.1

Expand All @@ -18,7 +24,6 @@ RUN dpkg --add-architecture armhf \
libc6-dev-armhf-cross \
libcap-dev:armhf \
libcap2-bin \
libidn11-dev:armhf \
make \
netcat-traditional \
nettle-dev:armhf \
Expand All @@ -38,9 +43,16 @@ RUN curl -sSL https://github.com/tcnksm/ghr/releases/download/v${ghrversion}/ghr
ENV CC "arm-linux-gnueabihf-gcc -isystem /usr/local/include"
RUN ln -s /usr/arm-linux-gnueabihf/lib/libm.so /usr/local/lib/

RUN curl -sSL https://ftl.pi-hole.net/libraries/libidn-${idnversion}.tar.gz | tar -xz \
&& cd libidn-${idnversion} \
&& ./configure --host=armv7-linux-gnueabi --enable-static --disable-shared --disable-doc --without-examples \
&& make -j $(nproc) install \
&& cd .. \
&& rm -r libidn-${idnversion}

RUN curl -sSL https://ftl.pi-hole.net/libraries/termcap-${termcapversion}.tar.gz | tar -xz \
&& cd termcap-${termcapversion} \
&& ./configure --host=arm-linux-gnueabihf --enable-static --disable-shared --disable-doc --without-examples \
&& ./configure --host=armv7-linux-gnueabihf --enable-static --disable-shared --disable-doc --without-examples \
&& make -j $(nproc) \
&& make install \
&& ls /usr/local/lib/ \
Expand All @@ -49,13 +61,19 @@ RUN curl -sSL https://ftl.pi-hole.net/libraries/termcap-${termcapversion}.tar.gz

RUN curl -sSL https://ftl.pi-hole.net/libraries/readline-${readlineversion}.tar.gz | tar -xz \
&& cd readline-${readlineversion} \
&& ./configure --host=arm-linux-gnueabihf --enable-static --disable-shared --disable-doc --without-examples \
&& ./configure --host=armv7-linux-gnueabihf --enable-static --disable-shared --disable-doc --without-examples \
&& make -j $(nproc) \
&& make install-static \
&& ls /usr/local/lib/ \
&& cd .. \
&& rm -r readline-${readlineversion}

# Uncomment the following line to test-compile FTL master during docker container development
# RUN git clone https://github.com/pi-hole/FTL.git && cd FTL && git checkout development \
# && bash build.sh -DLUA_READLINE=true && readelf -A ./pihole-FTL
# Test compile FTL's development branch, the result is removed from the final container
# We accept errors in the test step to be able to update the arch_tests if a change is intended
RUN git clone https://github.com/pi-hole/FTL.git \
&& cd FTL \
&& git checkout "${BRANCH}" \
&& bash .circleci/build-CI.sh "${STATIC}" "${BRANCH}" "${CIRCLE_TAG}" "${CIRCLE_JOB}" \
&& bash test/arch_test.sh \
&& cd .. \
&& rm -r FTL
79 changes: 79 additions & 0 deletions ftl-build/armv8a/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
FROM debian:buster

# For FTL test compilation
ARG CIRCLE_JOB="armv8a"
ARG CIRCLE_TAG="test-build"
ARG BRANCH="special/CI_development"

# ghr 0.13.0 2019-09-16
ARG ghrversion=0.13.0

ARG idnversion=1.36
ARG readlineversion=8.0
ARG termcapversion=1.3.1

RUN dpkg --add-architecture armhf \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
ca-certificates \
curl \
dnsutils \
file \
gcc-arm-linux-gnueabihf \
git \
libc6-dev-armhf-cross \
libcap-dev:armhf \
libcap2-bin \
make \
netcat-traditional \
nettle-dev:armhf \
ssh \
sqlite3 \
wget \
binutils \
cmake \
libc6:armhf \
&& rm -rf /var/lib/apt/lists/*

# Install ghr for GitHub Releases: https://github.com/tcnksm/ghr
RUN curl -sSL https://github.com/tcnksm/ghr/releases/download/v${ghrversion}/ghr_v${ghrversion}_linux_amd64.tar.gz | \
tar --strip-components=1 -C /usr/bin/ -xz \
ghr_v${ghrversion}_linux_amd64/ghr

ENV CC "arm-linux-gnueabihf-gcc -march=armv8-a -isystem /usr/local/include"
RUN ln -s /usr/arm-linux-gnueabihf/lib/libm.so /usr/local/lib/

RUN curl -sSL https://ftl.pi-hole.net/libraries/libidn-${idnversion}.tar.gz | tar -xz \
&& cd libidn-${idnversion} \
&& ./configure --host=armv8-linux-gnueabi --enable-static --disable-shared --disable-doc --without-examples \
&& make -j $(nproc) install \
&& cd .. \
&& rm -r libidn-${idnversion}

RUN curl -sSL https://ftl.pi-hole.net/libraries/termcap-${termcapversion}.tar.gz | tar -xz \
&& cd termcap-${termcapversion} \
&& ./configure --host=armv8-linux-gnueabihf --enable-static --disable-shared --disable-doc --without-examples \
&& make -j $(nproc) \
&& make install \
&& ls /usr/local/lib/ \
&& cd .. \
&& rm -r termcap-${termcapversion}

RUN curl -sSL https://ftl.pi-hole.net/libraries/readline-${readlineversion}.tar.gz | tar -xz \
&& cd readline-${readlineversion} \
&& ./configure --host=armv8-linux-gnueabihf --enable-static --disable-shared --disable-doc --without-examples \
&& make -j $(nproc) \
&& make install-static \
&& ls /usr/local/lib/ \
&& cd .. \
&& rm -r readline-${readlineversion}

# Test compile FTL's development branch, the result is removed from the final container
# We accept errors in the test step to be able to update the arch_tests if a change is intended
RUN git clone https://github.com/pi-hole/FTL.git \
&& cd FTL \
&& git checkout "${BRANCH}" \
&& bash .circleci/build-CI.sh "${STATIC}" "${BRANCH}" "${CIRCLE_TAG}" "${CIRCLE_JOB}" \
&& bash test/arch_test.sh \
&& cd .. \
&& rm -r FTL
28 changes: 23 additions & 5 deletions ftl-build/x86_32/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
FROM debian:stretch
FROM debian:buster

# For FTL test compilation
ARG CIRCLE_JOB="x86_32"
ARG CIRCLE_TAG="test-build"
ARG BRANCH="special/CI_development"

# ghr 0.13.0 2019-09-16
ARG ghrversion=0.13.0

ARG idnversion=1.36
ARG readlineversion=8.0
ARG termcapversion=1.3.1

Expand All @@ -18,7 +24,6 @@ RUN dpkg --add-architecture i386 \
git \
libcap2-bin \
libcap-dev:i386 \
libidn11-dev:i386 \
make \
netcat-traditional \
nettle-dev:i386 \
Expand All @@ -38,6 +43,13 @@ RUN curl -sSL https://github.com/tcnksm/ghr/releases/download/v${ghrversion}/ghr
ENV CC "gcc -m32"
RUN ln -s /usr/lib32/libm.so /usr/local/lib/

RUN curl -sSL https://ftl.pi-hole.net/libraries/libidn-${idnversion}.tar.gz | tar -xz \
&& cd libidn-${idnversion} \
&& ./configure --host=armv7-linux-gnueabi --enable-static --disable-shared --disable-doc --without-examples \
&& make -j $(nproc) install \
&& cd .. \
&& rm -r libidn-${idnversion}

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 \
Expand All @@ -56,6 +68,12 @@ RUN curl -sSL https://ftl.pi-hole.net/libraries/readline-${readlineversion}.tar.
&& cd .. \
&& rm -r readline-${readlineversion}

# Uncomment the following line to test-compile FTL master during docker container development
#RUN git clone https://github.com/pi-hole/FTL.git && cd FTL && git checkout development \
# && bash build.sh -DLUA_READLINE=true && readelf -A ./pihole-FTL
# Test compile FTL's development branch, the result is removed from the final container
# We accept errors in the test step to be able to update the arch_tests if a change is intended
RUN git clone https://github.com/pi-hole/FTL.git \
&& cd FTL \
&& git checkout "${BRANCH}" \
&& bash .circleci/build-CI.sh "${STATIC}" "${BRANCH}" "${CIRCLE_TAG}" "${CIRCLE_JOB}" \
&& bash test/arch_test.sh \
&& cd .. \
&& rm -r FTL
Loading