1- ARG BUILDER_IMAGE=arm32v7/debian:bookworm
2- ARG MAINTAINER=
"Andrey Volk <[email protected] >" 1+ ARG BUILDER_IMAGE=arm32v7/debian:bookworm-20240513
32
4- FROM ${BUILDER_IMAGE} AS builder
3+ FROM --platform=linux/arm/v7 ${BUILDER_IMAGE} AS builder
4+
5+ ARG MAINTAINER_NAME="Andrey Volk"
6+ ARG MAINTAINER_EMAIL=
"[email protected] " 7+
8+ ARG CODENAME=bookworm
9+ ARG ARCH=arm32
510
611ARG BUILD_NUMBER=42
712ARG GIT_SHA=0000000000
813
9- MAINTAINER ${MAINTAINER}
14+ ARG DATA_DIR=/data
15+
16+ LABEL maintainer="${MAINTAINER_NAME} <${MAINTAINER_EMAIL}>"
1017
1118SHELL ["/bin/bash" , "-c" ]
1219
13- RUN apt-get -q update && \
14- DEBIAN_FRONTEND=noninteractive apt-get -yq install \
20+ ENV DEBIAN_FRONTEND=noninteractive
21+
22+ RUN apt-get -q update \
23+ && apt-get -y -q install \
1524 apt-transport-https \
25+ autoconf \
26+ automake \
1627 build-essential \
1728 ca-certificates \
1829 cmake \
@@ -22,6 +33,7 @@ RUN apt-get -q update && \
2233 dh-autoreconf \
2334 dos2unix \
2435 doxygen \
36+ dpkg-dev \
2537 git \
2638 graphviz \
2739 libglib2.0-dev \
@@ -32,35 +44,45 @@ RUN apt-get -q update && \
3244
3345RUN update-ca-certificates --fresh
3446
35- ENV DATA_DIR=/data
36- WORKDIR ${DATA_DIR}
47+ RUN echo "export CODENAME=${CODENAME}" | tee ~/.env \
48+ && echo "export ARCH=${ARCH}" | tee -a ~/.env \
49+ && chmod +x ~/.env
3750
38- COPY . ${DATA_DIR}
39- RUN git reset --hard HEAD && git clean -xfd
51+ RUN git config --global --add safe.directory '*' \
52+ && git config --global user.name "${MAINTAINER_NAME}" \
53+ && git config --global user.email "${MAINTAINER_EMAIL}"
4054
41- RUN echo "export CODENAME=$(lsb_release -sc | tr -d '\n ')" | tee ~/.env && \
42- chmod +x ~/.env
55+ # Bootstrap and Build
56+ COPY . ${DATA_DIR}
57+ WORKDIR ${DATA_DIR}
4358
44- RUN git config --global --add safe.directory '*'
59+ RUN echo "export VERSION=$(dpkg-parsechangelog --show-field Version | cut -f1 -d'-')" \
60+ | tee -a ~/.env
4561
46- # Bootstrap and Build
47- RUN echo "export VERSION=$(dpkg-parsechangelog --show-field Version | cut -f1 -d'-')" | tee -a ~/.env
48- RUN . ~/.env && dch \
49- --controlmaint \
50- --distribution "${CODENAME}" \
51- --force-bad-version \
52- --force-distribution \
53- --newversion "${VERSION}-${BUILD_NUMBER}-${GIT_SHA}~${CODENAME}" \
54- "Nightly build, ${GIT_SHA}"
55-
56- RUN apt-get -q update && \
57- mk-build-deps --install --remove debian/control --tool "apt-get -y --no-install-recommends" && \
58- apt-get -y -f install
62+ RUN apt-get -q update \
63+ && mk-build-deps \
64+ --install \
65+ --remove debian/control \
66+ --tool "apt-get -y --no-install-recommends" \
67+ && apt-get -y -f install
5968
6069ENV DEB_BUILD_OPTIONS="parallel=1"
61- RUN . ~/.env && dch -b -M -v "${VERSION}-${BUILD_NUMBER}-${GIT_SHA}~${CODENAME}" \
62- --force-distribution -D "${CODENAME}" "Nightly build, ${GIT_SHA}"
63- RUN debuild -b -us -uc && mkdir OUT && mv -v ../*.deb OUT/.
70+
71+ RUN . ~/.env \
72+ && dch \
73+ --controlmaint \
74+ --distribution "${CODENAME}" \
75+ --force-bad-version \
76+ --force-distribution \
77+ --newversion "${VERSION}-${BUILD_NUMBER}-${GIT_SHA}~${CODENAME}" \
78+ "Nightly build, ${GIT_SHA}" \
79+ && debuild \
80+ --no-tgz-check \
81+ --build=binary \
82+ --unsigned-source \
83+ --unsigned-changes \
84+ && mkdir OUT \
85+ && mv -v ../*.{deb,changes} OUT/.
6486
6587# Artifacts image (mandatory part, the resulting image must have a single filesystem layer)
6688FROM scratch
0 commit comments