mirror of
https://github.com/LizardByte/Sunshine.git
synced 2024-12-27 06:16:15 +00:00
ddd67ce01d
Some checks failed
CI / GitHub Env Debug (push) Waiting to run
CI / Setup Release (push) Waiting to run
CI / Setup Flatpak Matrix (push) Waiting to run
CI / Linux Flatpak (push) Blocked by required conditions
CI / Linux ${{ matrix.type }} (--appimage-build, 22.04, AppImage) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 12) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 13) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 14) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest, true) (push) Blocked by required conditions
CI / Macports (macOS-${{ matrix.os_version }}) (12, true) (push) Blocked by required conditions
CI / Macports (macOS-${{ matrix.os_version }}) (13) (push) Blocked by required conditions
CI / Macports (macOS-${{ matrix.os_version }}) (14) (push) Blocked by required conditions
CI / Windows (push) Blocked by required conditions
CI Docker / Check Dockerfiles (push) Waiting to run
CI Docker / Setup Release (push) Blocked by required conditions
CI Docker / Lint Dockerfile${{ matrix.tag }} (push) Blocked by required conditions
CI Docker / Docker${{ matrix.tag }} (push) Blocked by required conditions
localize / Update Localization (push) Waiting to run
Build GH-Pages / update_pages (push) Waiting to run
CodeQL / Get language matrix (push) Has been cancelled
CodeQL / Analyze (${{ matrix.name }}) (push) Has been cancelled
107 lines
2.1 KiB
Docker
107 lines
2.1 KiB
Docker
# 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=bookworm
|
|
FROM ${BASE}:${TAG} AS sunshine-base
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
FROM sunshine-base AS sunshine-build
|
|
|
|
ARG BRANCH
|
|
ARG BUILD_VERSION
|
|
ARG COMMIT
|
|
# note: BUILD_VERSION may be blank
|
|
|
|
ENV BRANCH=${BRANCH}
|
|
ENV BUILD_VERSION=${BUILD_VERSION}
|
|
ENV COMMIT=${COMMIT}
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
# copy repository
|
|
WORKDIR /build/sunshine/
|
|
COPY --link .. .
|
|
|
|
# cmake and cpack
|
|
RUN <<_BUILD
|
|
#!/bin/bash
|
|
set -e
|
|
chmod +x ./scripts/linux_build.sh
|
|
./scripts/linux_build.sh \
|
|
--publisher-name='LizardByte' \
|
|
--publisher-website='https://app.lizardbyte.dev' \
|
|
--publisher-issue-url='https://app.lizardbyte.dev/support' \
|
|
--sudo-off
|
|
apt-get clean
|
|
rm -rf /var/lib/apt/lists/*
|
|
_BUILD
|
|
|
|
# run tests
|
|
WORKDIR /build/sunshine/build/tests
|
|
# hadolint ignore=SC1091
|
|
RUN <<_TEST
|
|
#!/bin/bash
|
|
set -e
|
|
export DISPLAY=:1
|
|
Xvfb ${DISPLAY} -screen 0 1024x768x24 &
|
|
./test_sunshine --gtest_color=yes
|
|
_TEST
|
|
|
|
FROM scratch AS artifacts
|
|
ARG BASE
|
|
ARG TAG
|
|
ARG TARGETARCH
|
|
COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine-${BASE}-${TAG}-${TARGETARCH}.deb
|
|
|
|
FROM sunshine-base AS sunshine
|
|
|
|
# copy deb from builder
|
|
COPY --link --from=artifacts /sunshine*.deb /sunshine.deb
|
|
|
|
# install sunshine
|
|
RUN <<_INSTALL_SUNSHINE
|
|
#!/bin/bash
|
|
set -e
|
|
apt-get update -y
|
|
apt-get install -y --no-install-recommends /sunshine.deb
|
|
apt-get clean
|
|
rm -rf /var/lib/apt/lists/*
|
|
_INSTALL_SUNSHINE
|
|
|
|
# network setup
|
|
EXPOSE 47984-47990/tcp
|
|
EXPOSE 48010
|
|
EXPOSE 47998-48000/udp
|
|
|
|
# setup user
|
|
ARG PGID=1000
|
|
ENV PGID=${PGID}
|
|
ARG PUID=1000
|
|
ENV PUID=${PUID}
|
|
ENV TZ="UTC"
|
|
ARG UNAME=lizard
|
|
ENV UNAME=${UNAME}
|
|
|
|
ENV HOME=/home/$UNAME
|
|
|
|
# setup user
|
|
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}
|
|
_SETUP_USER
|
|
|
|
USER ${UNAME}
|
|
WORKDIR ${HOME}
|
|
|
|
# entrypoint
|
|
ENTRYPOINT ["/usr/bin/sunshine"]
|