Skip to content

Commit

Permalink
Update base
Browse files Browse the repository at this point in the history
  • Loading branch information
robballantyne committed Mar 2, 2024
1 parent c9ab2ae commit ce52434
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 9 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
-
name: Permissions fixes
run: |
reponame="$(basename ${GITHUB_REPOSITORY})"
target="${HOME}/work/${reponame}/${reponame}/build/COPY*"
chmod -R ug+rwX ${target}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand Down Expand Up @@ -96,6 +102,12 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
-
name: Permissions fixes
run: |
reponame="$(basename ${GITHUB_REPOSITORY})"
target="${HOME}/work/${reponame}/${reponame}/build/COPY*"
chmod -R ug+rwX ${target}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand Down Expand Up @@ -154,6 +166,12 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
-
name: Permissions fixes
run: |
reponame="$(basename ${GITHUB_REPOSITORY})"
target="${HOME}/work/${reponame}/${reponame}/build/COPY*"
chmod -R ug+rwX ${target}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
# This file will be sourced in init.sh

function preflight_main() {
desktop_dir="${WORKSPACE}/home/${USER_NAME}/Desktop"
home_dir="/home/${USER_NAME}"
desktop_dir="${home_dir}/Desktop"
mkdir -p ${desktop_dir}
chown ${USER_NAME}.${USER_NAME} "${desktop_dir}"
ln -sf "${home_dir}" "${desktop_dir}"
ln -sf "${WORKSPACE}" "${desktop_dir}"

locale-gen $LANG
}

Expand Down
9 changes: 9 additions & 0 deletions build/COPY_ROOT/opt/ai-dock/bin/preflight.d/30-steam.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mkdir -p /opt/ai-dock/lib/steam-native

steam_dir="${home_dir}"/.steam/debian-installation/
proton_compat_dir="${steam_dir}/compatibilitytools.d/${GE_PROTON_VERSION}"
proton_binary_path="/opt/proton/${GE_PROTON_VERSION}/proton"
mkdir -p "${proton_compat_dir}"
cp /opt/ai-dock/share/proton/* "${proton_compat_dir}"
sed -i "s#PROTON_NAME#${GE_PROTON_VERSION}#g" "${proton_compat_dir}/compatibilitytool.vdf"
sed -i "s#PROTON_BINARY_PATH#${proton_binary_path}#g" "${proton_compat_dir}/toolmanifest.vdf"
4 changes: 3 additions & 1 deletion build/COPY_ROOT/opt/ai-dock/bin/supervisor-x-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ function cleanup() {
}

function start() {
source /opt/ai-dock/etc/environment.sh

if [[ ${SERVERLESS,,} = "true" ]]; then
printf "Refusing to start $SERVICE_NAME in serverless mode\n"
exec sleep 10
Expand All @@ -29,7 +31,7 @@ function start() {
# This symbolic link enables running Xorg inside a container with `-sharevts`
sudo ln -snf /dev/ptmx /dev/tty7
sudo mkdir -pm700 /tmp/runtime-user
sudo chown ${USER_NAME}:${USER_NAME} /tmp/runtime-user
sudo chown $(id -u):$(id -u) /tmp/runtime-user

if [[ $XPU_TARGET == "NVIDIA_GPU" && $(is_nvidia_capable) == "true" ]]; then
printf "Starting NVIDIA X server...\n"
Expand Down
39 changes: 35 additions & 4 deletions build/COPY_ROOT_EXTRA/opt/ai-dock/bin/build/layer1/init.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

set -eo pipefail
# Override this file to add extras to your build
umask 002
# Wine, Winetricks, Lutris, and PlayOnLinux, this process must be consistent with https://wiki.winehq.org/Ubuntu
Expand All @@ -13,7 +13,8 @@ apt-get install --install-recommends -y \
apt-get install --no-install-recommends -y \
q4wine \
playonlinux
LUTRIS_VERSION="$(curl -fsSL "https://api.github.com/repos/lutris/lutris/releases/latest" | jq -r '.tag_name' | sed 's/[^0-9\.\-]*//g')"
export LUTRIS_VERSION="$(curl -fsSL "https://api.github.com/repos/lutris/lutris/releases/latest" | jq -r '.tag_name' | sed 's/[^0-9\.\-]*//g')"
env-store LUTRIS_VERSION
curl -fsSL -O "https://github.com/lutris/lutris/releases/download/v${LUTRIS_VERSION}/lutris_${LUTRIS_VERSION}_all.deb"
apt-get install --no-install-recommends -y ./lutris_${LUTRIS_VERSION}_all.deb && rm -f "./lutris_${LUTRIS_VERSION}_all.deb"
curl -fsSL -o /usr/bin/winetricks "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks"
Expand All @@ -29,17 +30,47 @@ apt-get install --install-recommends -y \
libreoffice-style-breeze

# Steam
export GE_PROTON_VERSION="$(curl -fsSL "https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest" | jq -r '.tag_name')"
env-store GE_PROTON_VERSION
mkdir -p /opt/proton
wget -c "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/${GE_PROTON_VERSION}/${GE_PROTON_VERSION}.tar.gz" -O - | tar xz -C /opt/proton

dpkg-divert --add /usr/games/steam
$APT_INSTALL \
steam-installer
steam-installer \
libpipewire-0.3-0:i386 \
libxcb-res0:i386 \
libgtk2.0-0:i386
cp -f /opt/ai-dock/share/steam/bin/steam /usr/games/steam
chmod +x /usr/games/steam
cp -f /opt/ai-dock/share/steam/bin/steam-native /usr/bin/steam-native
chmod +x /usr/bin/steam-native
ln -sf /usr/games/steam /usr/bin/steam

# Graphics utils

apt-get update
$APT_INSTALL \
blender \
blender-data \
gimp \
inkscape

mkdir -p /opt/krita
wget -O /opt/krita/krita.appimage https://download.kde.org/stable/krita/5.2.2/krita-5.2.2-x86_64.appimage
chmod +x /opt/krita/krita.appimage
(cd /opt/krita && /opt/krita/krita.appimage --appimage-extract)
rm -f /opt/krita/krita.appimage
cp -rf /opt/krita/squashfs-root/usr/share/{applications,icons} /usr/share/
chmod +x /opt/ai-dock/bin/krita

# Chrome
wget -O /tmp/chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
$APT_INSTALL /tmp/chrome.deb
dpkg-divert --add /opt/google/chrome/google-chrome
cp -f /opt/google/chrome/google-chrome /opt/google/chrome/google-chrome.distrib
cp -f /opt/ai-dock/share/google-chrome/bin/google-chrome /opt/google/chrome/google-chrome


rm -rf /tmp/*

fix-permissions -o container
2 changes: 2 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ ENV APPIMAGE_EXTRACT_AND_RUN 1
ARG WINE_BRANCH=staging
ENV WINE_BRANCH=${WINE_BRANCH}

ARG STEAM_ARCHIVE_ID=20240216110829
ENV STEAM_ARCHIVE_ID=${STEAM_ARCHIVE_ID}
# Copy early so we can use scripts in the build - Changes to these files will invalidate the cache and cause a rebuild.
COPY --chown=0:1111 ./COPY_ROOT/ /

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
args:
IMAGE_BASE: ${IMAGE_BASE:-ghcr.io/ai-dock/base-image:cuda-11.8.0-runtime-22.04}
tags:
- "ghcr.io/ai-dock/desktop:${IMAGE_TAG:-cuda-11.8.0-runtime-22.04}"
- "ghcr.io/ai-dock/linux-desktop:${IMAGE_TAG:-cuda-11.8.0-runtime-22.04}"

image: ghcr.io/ai-dock/linux-desktop:${IMAGE_TAG:-cuda-11.8.0-base-22.04}

Expand Down Expand Up @@ -89,4 +89,4 @@ services:

# Magic bullet to solve networking issues - I don't like it
# Turn server works fine both within local network and for internet
#network_mode: "host"
#network_mode: "host"

0 comments on commit ce52434

Please sign in to comment.