Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
variable "CI_PR" {
default = false
description = "Build only the pull-request platform set."
}

group "default" {
targets = [
"clion-toolchain",
"debian-trixie",
"ubuntu-22-04",
"ubuntu-24-04",
"ubuntu-26-04",
]
}

# The shared Docker workflow exports /artifacts from these targets and uploads
# the files as workflow artifacts.
group "artifacts" {
targets = [
"debian-trixie",
"ubuntu-22-04",
"ubuntu-24-04",
"ubuntu-26-04",
]
}

target "_sunshine" {
context = "."
dockerfile = "docker/debian.dockerfile"
no-cache = true
platforms = CI_PR ? ["linux/amd64"] : [
"linux/amd64",
"linux/arm64/v8",
]
}

target "clion-toolchain" {
context = "."
dockerfile = "docker/clion-toolchain.dockerfile"
no-cache = true
platforms = ["linux/amd64"]
}

target "debian-trixie" {
inherits = ["_sunshine"]
args = {
BASE = "debian"
CUDA_PATCHES = "true"
TAG = "trixie"
}
labels = {
"dev.lizardbyte.image.variant" = "debian-trixie"
}
}

target "ubuntu-22-04" {
inherits = ["_sunshine"]
args = {
BASE = "ubuntu"
TAG = "22.04"
UBUNTU_TEST_REPO = "true"
}
labels = {
"dev.lizardbyte.image.variant" = "ubuntu-22.04"
}
}

target "ubuntu-24-04" {
inherits = ["_sunshine"]
args = {
BASE = "ubuntu"
TAG = "24.04"
}
labels = {
"dev.lizardbyte.image.variant" = "ubuntu-24.04"
}
}

target "ubuntu-26-04" {
inherits = ["_sunshine"]
args = {
BASE = "ubuntu"
TAG = "26.04"
}
labels = {
"dev.lizardbyte.image.variant" = "ubuntu-26.04"
}
}
4 changes: 0 additions & 4 deletions docker/clion-toolchain.dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# syntax=docker/dockerfile:1
# artifacts: false
# platforms: linux/amd64
# platforms_pr: linux/amd64
# no-cache-filters: toolchain-base,toolchain
ARG BASE=debian
ARG TAG=trixie-slim
FROM ${BASE}:${TAG} AS toolchain-base
Expand Down
38 changes: 23 additions & 15 deletions docker/debian-trixie.dockerfile → docker/debian.dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# syntax=docker/dockerfile:1
# artifacts: true
# platforms: linux/amd64,linux/arm64/v8
# platforms_pr: linux/amd64
# no-cache-filters: sunshine-base,artifacts,sunshine
ARG BASE=debian
ARG TAG=trixie
ARG BASE=ubuntu
ARG TAG=24.04
FROM ${BASE}:${TAG} AS sunshine-base

ENV DEBIAN_FRONTEND=noninteractive

FROM sunshine-base AS sunshine-deps

ARG CUDA_PATCHES=false
ARG UBUNTU_TEST_REPO=false

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Copy only the build script and necessary files first for better layer caching
# Copy only the build script and conditional patches first for better layer caching
WORKDIR /build/sunshine/
COPY --link scripts/linux_build.sh ./scripts/linux_build.sh
COPY --link packaging/linux/patches/ ./packaging/linux/patches/
Expand All @@ -23,9 +22,18 @@ RUN <<_DEPS
#!/bin/bash
set -e
chmod +x ./scripts/linux_build.sh

dependency_options=()
if [[ "${CUDA_PATCHES}" == "true" ]]; then
dependency_options+=(--cuda-patches)
fi
if [[ "${UBUNTU_TEST_REPO}" == "true" ]]; then
dependency_options+=(--ubuntu-test-repo)
fi

./scripts/linux_build.sh \
--step=deps \
--cuda-patches \
"${dependency_options[@]}" \
--sudo-off
apt-get clean
rm -rf /var/lib/apt/lists/*
Expand Down Expand Up @@ -75,7 +83,7 @@ RUN <<_TEST
#!/bin/bash
set -e
export DISPLAY=:1
Xvfb ${DISPLAY} -screen 0 1024x768x24 &
Xvfb "${DISPLAY}" -screen 0 1024x768x24 &
./test_sunshine --gtest_color=yes
_TEST

Expand Down Expand Up @@ -107,9 +115,9 @@ EXPOSE 48010
EXPOSE 47998-48000/udp

# setup user
ARG PGID=1000
ARG PGID=1001
ENV PGID=${PGID}
ARG PUID=1000
ARG PUID=1001
ENV PUID=${PUID}
ENV TZ="UTC"
ARG UNAME=lizard
Expand All @@ -122,10 +130,10 @@ RUN <<_SETUP_USER
#!/bin/bash
set -e
groupadd -f -g "${PGID}" "${UNAME}"
useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -u "${PUID}" "${UNAME}"
mkdir -p ${HOME}/.config/sunshine
ln -s ${HOME}/.config/sunshine /config
chown -R ${UNAME} ${HOME}
useradd -lm -d "${HOME}" -s /bin/bash -g "${PGID}" -u "${PUID}" "${UNAME}"
mkdir -p "${HOME}/.config/sunshine"
ln -s "${HOME}/.config/sunshine" /config
chown -R "${UNAME}" "${HOME}"
_SETUP_USER

USER ${UNAME}
Expand Down
134 changes: 0 additions & 134 deletions docker/ubuntu-22.04.dockerfile

This file was deleted.

Loading
Loading