build: allow to build the package in a clean container.

This commit is contained in:
Alexandre Pujol 2022-10-04 23:17:11 +01:00
parent 027a506eec
commit fa1f71a151
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
4 changed files with 159 additions and 0 deletions

View file

@ -0,0 +1,19 @@
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive \
TERM=xterm
# hadolint ignore=DL3008
RUN apt-get update -y && apt-get -qq -y --no-install-recommends upgrade && \
apt-get -qq -y --no-install-recommends install \
build-essential devscripts debhelper fakeroot config-package-dev \
git lsb-release rsync golang-go && \
apt-get -qy autoremove && \
apt-get -qq --purge remove -y .\*-doc$ && \
apt-get clean && \
rm -rf /usr/share/doc /usr/share/man /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
useradd -m -s /bin/bash -u 1000 build && \
chown -R build:build /home/build
USER build
CMD ["/bin/bash"]