From bcc95dc387ccd2aabe7686183fd47052cbe24f8a Mon Sep 17 00:00:00 2001 From: Penn Bauman Date: Fri, 21 Jul 2023 21:45:59 -0400 Subject: [PATCH] debian: add debian 12 "bookworm" release --- debian/12/Containerfile | 40 ++++++++++++++++++++++++++ debian/12/extra-packages | 38 ++++++++++++++++++++++++ debian/12/toolbox-flatpak-xdg-utils.sh | 12 ++++++++ 3 files changed, 90 insertions(+) create mode 100644 debian/12/Containerfile create mode 100644 debian/12/extra-packages create mode 100644 debian/12/toolbox-flatpak-xdg-utils.sh diff --git a/debian/12/Containerfile b/debian/12/Containerfile new file mode 100644 index 00000000..b359c64d --- /dev/null +++ b/debian/12/Containerfile @@ -0,0 +1,40 @@ +FROM docker.io/library/debian:12 + +LABEL com.github.containers.toolbox="true" \ + name="debian-toolbox" \ + version="12" \ + usage="This image is meant to be used with the toolbox command" \ + summary="Base image for creating Debian toolbox containers" \ + maintainer="" + +# Remove apt configuration optimized for containers +# Remove docker-gzip-indexes to help with "command-not-found" +RUN rm /etc/apt/apt.conf.d/docker-gzip-indexes /etc/apt/apt.conf.d/docker-no-languages + +# Enable myhostname nss plugin for clean hostname resolution without patching +# hosts (at least for sudo), add it right after 'files' entry. We expect that +# this entry is not present yet. Do this early so that package postinst (which +# adds it too late in the order) skips this step +RUN sed -Ei 's/^(hosts:.*)(\)\s*(.*)/\1\2 myhostname \3/' /etc/nsswitch.conf + +# Prevent questions when installing packages +ARG DEBIAN_FRONTEND=noninteractive + +# Make flatpak-xdg-utils usable inside the toolbox +COPY toolbox-flatpak-xdg-utils.sh /etc/profile.d + +# Install extra packages as well as libnss-myhostname +COPY extra-packages / +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y install \ + libnss-myhostname \ + $(cat extra-packages | xargs) && \ + rm -rd /var/lib/apt/lists/* +RUN rm /extra-packages + +# Enable password less sudo +RUN sed -i -e 's/ ALL$/ NOPASSWD:ALL/' /etc/sudoers + +RUN echo VARIANT_ID=container >> /etc/os-release +# ? +RUN touch /etc/localtime diff --git a/debian/12/extra-packages b/debian/12/extra-packages new file mode 100644 index 00000000..928cf4c5 --- /dev/null +++ b/debian/12/extra-packages @@ -0,0 +1,38 @@ +bash-completion +bc +bzip2 +diffutils +findutils +flatpak-xdg-utils +git +gnupg +gpgsm +hostname +iproute2 +iputils-tracepath +keyutils +less +libcap2-bin +libkrb5-3 +libnss-mdns +lsof +man-db +manpages +mtr +nano +openssh-client +passwd +pigz +procps +rsync +sudo +tcpdump +time +traceroute +tree +unzip +util-linux +wget +xauth +xz-utils +zip diff --git a/debian/12/toolbox-flatpak-xdg-utils.sh b/debian/12/toolbox-flatpak-xdg-utils.sh new file mode 100644 index 00000000..ca1dcae4 --- /dev/null +++ b/debian/12/toolbox-flatpak-xdg-utils.sh @@ -0,0 +1,12 @@ +# shellcheck shell=sh disable=SC2153 +# Add flatpak-xdg-utils to PATH to allow running nested toolbox +# containers (i.e. uses flatpak-spawn). +# This also makes the xdg-utils replacements available as part of +# flatpak-xdg-utils (e.g. xdg-open) usable inside toolbox (requires +# xdg-desktop-portal on the host side). + +if [ -f /run/.containerenv ] && [ -f /run/.toolboxenv ] +then + PATH="/usr/libexec/flatpak-xdg-utils:$PATH" + export PATH +fi