Skip to content

Commit

Permalink
added initial containers
Browse files Browse the repository at this point in the history
  • Loading branch information
nakarma committed Jul 12, 2024
1 parent 7f52bf1 commit ca0a2d4
Show file tree
Hide file tree
Showing 13 changed files with 323 additions and 0 deletions.
22 changes: 22 additions & 0 deletions rpios-base/Containerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM scratch

ADD rpios-stable-rootfs-arm64.tar.gz /

ENV DEBIAN_FRONTEND noninteractive

RUN wget http://archive.raspberrypi.com/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb \
&& dpkg -i ./raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb \
&& rm ./raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb \
&& echo "deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware" >> /etc/apt/sources.list \
&& echo "deb http://deb.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list \
&& echo "deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list \
&& echo "deb http://deb.debian.org/debian bookworm-backports main" >> /etc/apt/sources.list \
&& echo "deb http://archive.raspberrypi.org/debian/ bookworm main" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get -y full-upgrade \
&& mkdir -p /etc/udev/rules.d \
&& apt-get clean \
&& apt-get -y --purge autoremove \
&& rm -rf /var/lib/apt/lists/*

CMD ["bash"]
22 changes: 22 additions & 0 deletions rpios-base/Containerfile.armhf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM scratch

ADD rpios-stable-rootfs-armhf.tar.gz /

ENV DEBIAN_FRONTEND noninteractive

RUN wget http://archive.raspberrypi.com/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb \
&& dpkg -i ./raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb \
&& rm ./raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb \
&& echo "deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware" >> /etc/apt/sources.list \
&& echo "deb http://deb.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list \
&& echo "deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list \
&& echo "deb http://deb.debian.org/debian bookworm-backports main" >> /etc/apt/sources.list \
&& echo "deb http://archive.raspberrypi.org/debian/ bookworm main" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get -y full-upgrade \
&& mkdir -p /etc/udev/rules.d \
&& apt-get clean \
&& apt-get -y --purge autoremove \
&& rm -rf /var/lib/apt/lists/*

CMD ["bash"]
3 changes: 3 additions & 0 deletions rpios-base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# RPIOS-BASE

Basic Raspberry Pi OS container built using debootstrap. Intended as a foundation for other containers running on the Raspberry Pi.
72 changes: 72 additions & 0 deletions rpios-base/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

if [ -f "./container.conf" ]; then
source ./container.conf
else
echo ""
echo "Configuration not found. Exiting."
echo ""
exit 1
fi

SETUP() {
if [ ! -f "/usr/share/keyrings/raspberrypi-archive-keyring.gpg" ]; then
wget http://archive.raspberrypi.com/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb
sudo dpkg -i ./raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb
fi
}

BOOTSTRAP() {
case "$1" in
rpi)
sudo debootstrap --arch=$ARCH --components=main,contrib,non-free,rpi --include=wget,bash-completion \
--keyring=/usr/share/keyrings/raspberrypi-archive-keyring.gpg bullseye build/ http://archive.raspberrypi.com/debian/
;;
*)
sudo debootstrap --arch=$ARCH --variant=$VARIANT --components=main,contrib,non-free \
--include=wget,bash-completion,sudo,ca-certificates,findutils,gnupg,dirmngr,inetutils-ping,netbase,curl,udev,procps \
$RELEASE build/ http://deb.debian.org/debian/ \
&& cd build \
&& sudo tar --numeric-owner -czvf ../rpios-stable-rootfs-$ARCH.tar.gz ./* \
&& cd .. \
&& sudo rm -rf build
;;
esac
}

IMG() {
podman build --squash -t $IMAGE:$ARCH-latest -f ./Containerfile.$ARCH
}

CHECK() {
if [ -f "./rpios-stable-rootfs-$ARCH.tar.gz" ]; then
echo ""
read -e -p "Existing rootfs found.. Delete and recreate [Y/N]: " -i "N" REBOOTSTRAP
if [[ "$REBOOTSTRAP" == [yY] ]]; then
BOOTSTRAP
fi
else
BOOTSTRAP
fi
}

case "$1" in
armhf)
ARCH=armhf
SETUP
CHECK
IMG
;;
arm64)
ARCH=arm64
SETUP
CHECK
IMG
;;
*)
echo ""
echo "Usage: $(basename $0) {armhf|arm64}"
echo ""
exit 1
;;
esac
4 changes: 4 additions & 0 deletions rpios-base/container.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
IMAGE=${PWD##*/}
ARCH=arm64
RELEASE=bookworm
VARIANT=minbase
48 changes: 48 additions & 0 deletions rpios-gnome/Containerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM nakarma/containers/rpios-mesa:arm64-latest

ENV DEBIAN_FRONTEND noninteractive

RUN apt update \
&& apt -y full-upgrade \
&& apt-get -y --no-install-recommends install \
dbus systemd systemd-sysv cron anacron ecryptfs-utils \
desktop-base gdm3 gnome-session gnome-shell \
gnome-terminal gnome-shell-extensions gnome-shell-extensions-extra \
gnome-shell-extension-appindicator gnome-shell-extension-arc-menu \
gnome-shell-extension-autohidetopbar gnome-shell-extension-bluetooth-quick-connect \
gnome-shell-extension-caffeine gnome-shell-extension-dashtodock \
gnome-shell-extension-dash-to-panel gnome-shell-extension-desktop-icons-ng \
gnome-shell-extension-gamemode gnome-shell-extension-gsconnect \
gnome-shell-extension-hide-activities gnome-shell-extension-impatience \
gnome-shell-extension-no-annoyance gnome-shell-extension-prefs \
gnome-shell-extension-system-monitor gnome-shell-extension-tiling-assistant \
gnome-shell-extension-top-icons-plus gnome-shell-extension-vertical-overview \
gnome-shell-extension-weather \
gnome-accessibility-themes gnome-backgrounds gnome-icon-theme gnome-keyring \
gnome-menus gnome-nettool gnome-online-accounts gnome-packagekit \
gnome-remote-desktop gnome-settings-daemon gnome-system-monitor \
gnome-system-tools gnome-text-editor gnome-themes-extra gnome-tweaks \
gnome-user-share gnome-video-effects gnome-weather \
eog file-roller gcr nautilus nautilus-extension-gnome-terminal orca \
gnome-calculator gnome-calendar gnome-characters gnome-clocks \
gnome-colors gnome-control-center gnome-dictionary gnome-font-viewer \
wireplumber polkitd remmina seahorse zenity \
papirus-icon-theme \
neovim mpv \
synaptic flatpak \
&& apt-get -y --purge autoremove \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/var/log/alternatives.log \
/var/log/apt/history.log \
/var/log/apt/term.log \
/var/log/dpkg.log

RUN systemctl enable gdm.service

STOPSIGNAL SIGRTMIN+3

#VOLUME [ "/sys/fs/cgroup", "/run", "/run/lock", "/tmp" ]

CMD [ "/sbin/init" ]
48 changes: 48 additions & 0 deletions rpios-gnome/Containerfile.armhf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM nakarma/containers/rpios-mesa:armhf-latest

ENV DEBIAN_FRONTEND noninteractive

RUN apt update \
&& apt -y full-upgrade \
&& apt-get -y --no-install-recommends install \
dbus systemd systemd-sysv cron anacron ecryptfs-utils \
desktop-base gdm3 gnome-session gnome-shell \
gnome-terminal gnome-shell-extensions gnome-shell-extensions-extra \
gnome-shell-extension-appindicator gnome-shell-extension-arc-menu \
gnome-shell-extension-autohidetopbar gnome-shell-extension-bluetooth-quick-connect \
gnome-shell-extension-caffeine gnome-shell-extension-dashtodock \
gnome-shell-extension-dash-to-panel gnome-shell-extension-desktop-icons-ng \
gnome-shell-extension-gamemode gnome-shell-extension-gsconnect \
gnome-shell-extension-hide-activities gnome-shell-extension-impatience \
gnome-shell-extension-no-annoyance gnome-shell-extension-prefs \
gnome-shell-extension-system-monitor gnome-shell-extension-tiling-assistant \
gnome-shell-extension-top-icons-plus gnome-shell-extension-vertical-overview \
gnome-shell-extension-weather \
gnome-accessibility-themes gnome-backgrounds gnome-icon-theme gnome-keyring \
gnome-menus gnome-nettool gnome-online-accounts gnome-packagekit \
gnome-remote-desktop gnome-settings-daemon gnome-system-monitor \
gnome-system-tools gnome-text-editor gnome-themes-extra gnome-tweaks \
gnome-user-share gnome-video-effects gnome-weather \
eog file-roller gcr nautilus nautilus-extension-gnome-terminal orca \
gnome-calculator gnome-calendar gnome-characters gnome-clocks \
gnome-colors gnome-control-center gnome-dictionary gnome-font-viewer \
wireplumber polkitd remmina seahorse zenity \
papirus-icon-theme \
neovim mpv \
synaptic flatpak \
&& apt-get -y --purge autoremove \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/var/log/alternatives.log \
/var/log/apt/history.log \
/var/log/apt/term.log \
/var/log/dpkg.log

RUN systemctl enable gdm.service

STOPSIGNAL SIGRTMIN+3

#VOLUME [ "/sys/fs/cgroup", "/run", "/run/lock", "/tmp" ]

CMD [ "/sbin/init" ]
3 changes: 3 additions & 0 deletions rpios-gnome/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#RPIOS-BASE

Raspberry Pi OS container with GNOME and Wayland pre-installed. Built on "RPIOS-MESA", which in turn is built on "RPIOS-BASE". Intended as a foundation for other containers running on the Raspberry Pi.
23 changes: 23 additions & 0 deletions rpios-gnome/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

IMAGE=${PWD##*/}

BUILD() {
podman build -t $IMAGE:$ARCH-latest -f $1
}

case "$1" in
armhf)
ARCH=armhf
BUILD ./Containerfile.armhf
;;
arm64)
ARCH=arm64
BUILD ./Containerfile.arm64
;;
*)
echo ""
echo "Usage: $(basename $0) {armhf|arm64}"
echo ""
;;
esac
26 changes: 26 additions & 0 deletions rpios-mesa/Containerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM nakarma/containers/rpios-base:arm64-latest

ENV DEBIAN_FRONTEND noninteractive

RUN apt update \
&& apt -y full-upgrade \
&& apt -y --no-install-recommends install libegl-mesa0 libegl1-mesa libgbm1 \
libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa \
libgles2-mesa libglu1-mesa libglw1-mesa libglx-mesa0 \
libosmesa6 mesa-utils mesa-utils-extra mesa-va-drivers \
mesa-vdpau-drivers mesa-vulkan-drivers libvulkan1 vulkan-tools \
pipewire pipewire-alsa pipewire-pulse alsa-tools \
libsdl-console libsdl-gfx1.2-5 libsdl-image1.2 libsdl-mixer1.2 \
libsdl-net1.2 libsdl-sound1.2 libsdl-ttf2.0-0 libsdl1.2debian \
libsdl2-2.0-0 libsdl2-gfx-1.0-0 libsdl2-image-2.0-0 \
libsdl2-mixer-2.0-0 libsdl2-net-2.0-0 libsdl2-ttf-2.0-0 \
&& apt-get -y --purge autoremove \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/var/log/alternatives.log \
/var/log/apt/history.log \
/var/log/apt/term.log \
/var/log/dpkg.log

CMD ["bash"]
26 changes: 26 additions & 0 deletions rpios-mesa/Containerfile.armhf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM localhost/rpios-base:armhf-latest

ENV DEBIAN_FRONTEND noninteractive

RUN apt update \
&& apt -y full-upgrade \
&& apt -y --no-install-recommends install libegl-mesa0 libegl1-mesa libgbm1 \
libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa \
libgles2-mesa libglu1-mesa libglw1-mesa libglx-mesa0 \
libosmesa6 mesa-utils mesa-utils-extra mesa-va-drivers \
mesa-vdpau-drivers mesa-vulkan-drivers libvulkan1 vulkan-tools \
pipewire pipewire-alsa pipewire-pulse alsa-tools \
libsdl-console libsdl-gfx1.2-5 libsdl-image1.2 libsdl-mixer1.2 \
libsdl-net1.2 libsdl-sound1.2 libsdl-ttf2.0-0 libsdl1.2debian \
libsdl2-2.0-0 libsdl2-gfx-1.0-0 libsdl2-image-2.0-0 \
libsdl2-mixer-2.0-0 libsdl2-net-2.0-0 libsdl2-ttf-2.0-0 \
&& apt-get -y --purge autoremove \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/var/log/alternatives.log \
/var/log/apt/history.log \
/var/log/apt/term.log \
/var/log/dpkg.log

CMD ["bash"]
3 changes: 3 additions & 0 deletions rpios-mesa/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# RPIOS-MESA

Raspberry Pi OS with graphics and SDL pre-installed. Built on "RPIOS-BASE". Intended as a foundation for other containers running on the Raspberry Pi.
23 changes: 23 additions & 0 deletions rpios-mesa/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

IMAGE=${PWD##*/}

BUILD() {
podman build -t $IMAGE:$ARCH-latest -f $1
}

case "$1" in
armhf)
ARCH=armhf
BUILD ./Containerfile.armhf
;;
arm64)
ARCH=arm64
BUILD ./Containerfile.arm64
;;
*)
echo ""
echo "Usage: $(basename $0) {armhf|arm64}"
echo ""
;;
esac

0 comments on commit ca0a2d4

Please sign in to comment.