# podman build --build-arg BUILDER_USER=$(whoami) -t sid-development .
#
# podman run --rm -it --userns=keep-id -v /work/ema/debian-mirror:/debian-mirror sid-development

FROM debian:unstable

ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8

ARG BUILDER_USER

COPY build-kernel /usr/local/bin/
RUN chmod +x /usr/local/bin/build-kernel

COPY build-installer /usr/local/bin/
RUN chmod +x /usr/local/bin/build-installer

COPY build-netinst /usr/local/bin/
RUN chmod +x /usr/local/bin/build-netinst

RUN printf 'deb http://deb.debian.org/debian sid main\ndeb-src http://deb.debian.org/debian sid main\n' > /etc/apt/sources.list && \
  apt-get update && \
  apt-get -y dist-upgrade && \
  apt-get -y build-dep linux && \
  apt-get -y build-dep debian-installer && \
  apt-get -y install debian-cd sbsigntool debmirror debian-archive-keyring uuid-runtime libfile-slurp-perl moreutils lynx tofrodos less git gpg python3-debian python3-dacite devscripts sudo fakeroot vim --no-install-recommends && \
  echo "${BUILDER_USER} ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers.d/sid-development

CMD ["/bin/bash"]
