|
| 1 | +ARG BUILDER_IMAGE=arm32v7/debian:trixie-20250630 |
| 2 | + |
| 3 | +FROM --platform=linux/arm/v7 ${BUILDER_IMAGE} AS builder |
| 4 | + |
| 5 | +ARG MAINTAINER_NAME="Andrey Volk" |
| 6 | +ARG MAINTAINER_EMAIL="andrey@signalwire.com" |
| 7 | + |
| 8 | +ARG CODENAME=trixie |
| 9 | +ARG ARCH=arm32 |
| 10 | + |
| 11 | +ARG BUILD_NUMBER=42 |
| 12 | +ARG GIT_SHA=0000000000 |
| 13 | + |
| 14 | +ARG DATA_DIR=/data |
| 15 | + |
| 16 | +LABEL maintainer="${MAINTAINER_NAME} <${MAINTAINER_EMAIL}>" |
| 17 | + |
| 18 | +SHELL ["/bin/bash", "-c"] |
| 19 | + |
| 20 | +ENV DEBIAN_FRONTEND=noninteractive |
| 21 | + |
| 22 | +RUN apt-get -q update \ |
| 23 | + && apt-get -y -q install \ |
| 24 | + apt-transport-https \ |
| 25 | + autoconf \ |
| 26 | + automake \ |
| 27 | + build-essential \ |
| 28 | + ca-certificates \ |
| 29 | + cmake \ |
| 30 | + curl \ |
| 31 | + debhelper \ |
| 32 | + devscripts \ |
| 33 | + dh-autoreconf \ |
| 34 | + docbook-xsl \ |
| 35 | + dos2unix \ |
| 36 | + doxygen \ |
| 37 | + dpkg-dev \ |
| 38 | + git \ |
| 39 | + graphviz \ |
| 40 | + libglib2.0-dev \ |
| 41 | + libssl-dev \ |
| 42 | + lsb-release \ |
| 43 | + pkg-config \ |
| 44 | + wget |
| 45 | + |
| 46 | +RUN update-ca-certificates --fresh |
| 47 | + |
| 48 | +RUN echo "export CODENAME=${CODENAME}" | tee ~/.env \ |
| 49 | + && echo "export ARCH=${ARCH}" | tee -a ~/.env \ |
| 50 | + && chmod +x ~/.env |
| 51 | + |
| 52 | +RUN git config --global --add safe.directory '*' \ |
| 53 | + && git config --global user.name "${MAINTAINER_NAME}" \ |
| 54 | + && git config --global user.email "${MAINTAINER_EMAIL}" |
| 55 | + |
| 56 | +# Bootstrap and Build |
| 57 | +COPY . ${DATA_DIR} |
| 58 | +WORKDIR ${DATA_DIR} |
| 59 | + |
| 60 | +RUN echo "export VERSION=$(dpkg-parsechangelog --show-field Version | cut -f1 -d'-')" \ |
| 61 | + | tee -a ~/.env |
| 62 | + |
| 63 | +RUN apt-get -q update \ |
| 64 | + && mk-build-deps \ |
| 65 | + --install \ |
| 66 | + --remove debian/control \ |
| 67 | + --tool "apt-get -y --no-install-recommends" \ |
| 68 | + && apt-get -y -f install |
| 69 | + |
| 70 | +ENV DEB_BUILD_OPTIONS="parallel=1" |
| 71 | + |
| 72 | +RUN dpkg-buildflags --export=sh |
| 73 | + |
| 74 | +RUN . ~/.env \ |
| 75 | + && dch \ |
| 76 | + --controlmaint \ |
| 77 | + --distribution "${CODENAME}" \ |
| 78 | + --force-bad-version \ |
| 79 | + --force-distribution \ |
| 80 | + --newversion "${VERSION}-${BUILD_NUMBER}-${GIT_SHA}~${CODENAME}" \ |
| 81 | + "Nightly build, ${GIT_SHA}" \ |
| 82 | + && debuild \ |
| 83 | + --no-tgz-check \ |
| 84 | + --build=binary \ |
| 85 | + --unsigned-source \ |
| 86 | + --unsigned-changes \ |
| 87 | + && mkdir OUT \ |
| 88 | + && mv -v ../*.{deb,changes} OUT/. |
| 89 | + |
| 90 | +# Artifacts image (mandatory part, the resulting image must have a single filesystem layer) |
| 91 | +FROM scratch |
| 92 | +COPY --from=builder /data/OUT/ / |
0 commit comments