Remove support for DinD

This commit is contained in:
Josh.5
2023-08-22 14:45:00 +12:00
committed by Josh Sunnex
parent 577d0ef299
commit ac7dc533e7
8 changed files with 6 additions and 148 deletions

View File

@@ -277,17 +277,16 @@ RUN \
# && make \
# && make install
#&& \
echo "**** Configure flatpak ****" \
&& chmod u-s /usr/bin/bwrap \
&& flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo \
&& \
echo "**** Section cleanup ****" \
&& pacman -Scc --noconfirm \
&& rm -fr /var/lib/pacman/sync/* \
&& \
echo
# TODO: Add support for dind
# Ref:
# - https://github.com/docker-library/docker/blob/master/20.10/dind/Dockerfile
# - https://docs.nvidia.com/ai-enterprise/deployment-guide/dg-docker.html
# Install noVNC
# TODO: Add nginx or remove the whole proxy setup and just connect directly for audio (I think that is the better option)
ARG NOVNC_VERSION=1.2.0

View File

@@ -316,7 +316,6 @@ RUN \
gnome-software-plugin-flatpak \
&& \
echo "**** Configure flatpak ****" \
&& chmod u+s /usr/bin/bwrap \
&& flatpak remote-add flathub https://flathub.org/repo/flathub.flatpakrepo \
&& dpkg-statoverride --update --add root root 0755 /usr/bin/bwrap \
&& \
@@ -330,50 +329,6 @@ RUN \
&& \
echo
# Setup dind
# Ref:
# - https://github.com/docker-library/docker/blob/master/20.10/dind/Dockerfile
# - https://docs.nvidia.com/ai-enterprise/deployment-guide/dg-docker.html
ARG DOCKER_VERSION=20.10.18
ARG DOCKER_COMPOSE_VERSION=v2.11.2
RUN \
echo "**** Fetch Docker static binary package ****" \
&& cd /tmp \
&& wget -O /tmp/docker-${DOCKER_VERSION}.tgz \
https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz \
&& \
echo "**** Extract static binaries ****" \
&& mkdir -p /usr/local/bin \
&& tar --extract \
--file /tmp/docker-${DOCKER_VERSION}.tgz \
--strip-components 1 \
--directory /usr/local/bin/ \
--no-same-owner \
&& \
echo "**** Install docker-compose ****" \
&& wget -O /usr/local/bin/docker-compose "https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-Linux-x86_64" \
&& chmod +x /usr/local/bin/docker-compose \
&& \
# TODO: Fix nvidia-container-toolkit. This is not yet offically supported in Bookworm. If we really need it, we can install it with debian11
#echo "**** Install nvidia runtime ****" \
# && distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
# && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | apt-key add - \
# && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | tee /etc/apt/sources.list.d/nvidia-docker.list \
# && apt-get update \
# && apt-get install -y \
# nvidia-container-toolkit \
#&& \
echo "**** Section cleanup ****" \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y \
&& rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/* \
&& \
echo
VOLUME /var/lib/docker
# TODO: Deprecate neko and noVNC for KasmVNC
# Install Neko server
COPY --from=m1k1o/neko:base /usr/bin/neko /usr/bin/neko

View File

@@ -3,7 +3,7 @@
Steam runs with Flatpak. These Flatpaks are instlled into the `default` user's home directory so they persist between container updates. Sometimes Flatpaks can get into a knot between major Steam Headless updates. In such cases, it may not work correctly. To fix this, just delete the Flatpak runtime in your `default` user's home directory a restart the container.
1) Stop the container.
2) Delete the directory `~/.local/share/flatpak`
2) Delete the directory `<SteamHeadless Home>/.local/share/flatpak`
3) Re-create the container. Don't just restart it. This will trigger an update of the required Flatpak runtimes in the home directory.
4) Reinstall any missing Flatpaks from the Software app.

View File

@@ -80,7 +80,7 @@ function install_nvidia_driver {
--no-libglx-indirect \
--no-install-libglvnd \
> ${USER_HOME}/Downloads/nvidia_gpu_install.log 2>&1
else
else
echo "Installing Legacy NVIDIA driver v${nvidia_host_driver_version} to match what is running on the host"
chmod +x ${USER_HOME}/Downloads/NVIDIA_${nvidia_host_driver_version}.run
${USER_HOME}/Downloads/NVIDIA_${nvidia_host_driver_version}.run \

View File

@@ -1,24 +0,0 @@
echo "**** Configure Dockerd ****"
if ([ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then
if [ ! -S /var/run/docker.sock ]; then
echo "Enable Dockerd daemon"
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/dind.ini
else
echo "Docker socket has been passed in from host. Using that instead"
fi
# Configure 'default' user to run docker commands without sudo
if ! getent group docker &> /dev/null; then
echo "Add user '${USER}' to docker group for sudoless execution"
groupadd docker
usermod -aG docker ${USER}
mkdir -p ${USER_HOME:?}/.docker
chown -R ${PUID}:${PGID} ${USER_HOME:?}/.docker
chmod -R g+rwx ${USER_HOME:?}/.docker
fi
else
echo "Dockerd daemon not available when container is run in 'secondary' mode"
fi
echo "DONE"

View File

@@ -31,10 +31,4 @@ if [ "${MODE}" == "s" ] | [ "${MODE}" == "secondary" ]; then
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/udev.ini
fi
# TODO: Disabled some stuff for development... re-enable it after Arch is working
echo " - DISABLEING dind"
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/dind.ini
#echo " - DISABLEING desktop"
#sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/desktop.ini
echo "DONE"

View File

@@ -1,14 +0,0 @@
[program:dind]
priority=20
autostart=false
autorestart=true
user=root
command=/usr/bin/start-dind.sh
stopsignal=INT
stdout_logfile=/home/%(ENV_USER)s/.cache/log/dind.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=7
stderr_logfile=/home/%(ENV_USER)s/.cache/log/dind.err.log
stderr_logfile_maxbytes=10MB
stderr_logfile_backups=7

View File

@@ -1,52 +0,0 @@
#!/usr/bin/env bash
###
# File: start-dind.sh
# Project: bin
# File Created: Saturday, 8th October 2022 1:49:45 pm
# Author: Josh.5 (jsunnex@gmail.com)
# -----
# Last Modified: Saturday, 8th October 2022 1:49:45 pm
# Modified By: Josh.5 (jsunnex@gmail.com)
###
set -e
# CATCH TERM SIGNAL:
_term() {
kill -TERM "$docker_pid" 2>/dev/null
}
trap _term SIGTERM SIGINT
# CONFIGURE:
# Refrences:
# - https://raw.githubusercontent.com/docker/docker/42b1175eda071c0e9121e1d64345928384a93df1/hack/dind
#
# apparmor sucks and Docker needs to know that it's in a container (c) @tianon
export container=docker
if [ -d /sys/kernel/security ] && ! mountpoint -q /sys/kernel/security; then
mount -t securityfs none /sys/kernel/security || {
echo >&2 'Could not mount /sys/kernel/security.'
echo >&2 'AppArmor detection and --privileged mode might break.'
}
fi
# cgroup v2: enable nesting
if [ -f /sys/fs/cgroup/cgroup.controllers ]; then
# move the processes from the root group to the /init group,
# otherwise writing subtree_control fails with EBUSY.
# An error during moving non-existent process (i.e., "cat") is ignored.
mkdir -p /sys/fs/cgroup/init
xargs -rn1 < /sys/fs/cgroup/cgroup.procs > /sys/fs/cgroup/init/cgroup.procs || :
# enable controllers
sed -e 's/ / +/g' -e 's/^/+/' < /sys/fs/cgroup/cgroup.controllers \
> /sys/fs/cgroup/cgroup.subtree_control
fi
# EXECUTE PROCESS:
/usr/local/bin/dockerd &
docker_pid=$!
# WAIT FOR CHILD PROCESS:
wait "$docker_pid"