Skip to content

Commit

Permalink
debian: add debian 12 "bookworm" release
Browse files Browse the repository at this point in the history
  • Loading branch information
pennbauman committed Jul 22, 2023
1 parent ebaa71e commit bcc95dc
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
40 changes: 40 additions & 0 deletions debian/12/Containerfile
Original file line number Diff line number Diff line change
@@ -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:.*)(\<files\>)\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
38 changes: 38 additions & 0 deletions debian/12/extra-packages
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions debian/12/toolbox-flatpak-xdg-utils.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bcc95dc

Please sign in to comment.