Fix docker caching and correcting version in Gitea workflow
build / build-linux-amd64 (push) Successful in 1m56s

This commit is contained in:
2026-05-25 00:07:15 +02:00
parent 8fa1b3e609
commit bc61ec6046
5 changed files with 63 additions and 71 deletions
+9 -22
View File
@@ -1,22 +1,13 @@
# Minimal debian image that installs hbbs/hbbr/rustdesk-utils from the .deb
# artifact produced by the Gitea Actions workflow at
# https://gitea.cstudio.ch/mike/rustdesk-server.
#
# To force a fresh artifact pull on rebuild, bump CACHE_BUST (e.g.
# `docker compose build --build-arg CACHE_BUST=$(date +%s)`).
# Minimal debian image with the tooling needed to download + install the
# hbbs/hbbr/rustdesk-utils .deb at *container start* (not build time).
# The actual fetch happens in /usr/local/sbin/entrypoint.sh, which calls
# fetch-artifact.sh on every start — see docker-compose.yml for the runtime
# env vars (GITEA_URL, GITEA_OWNER, GITEA_REPO, GITEA_BRANCH, ARTIFACT_URL).
#
# The Gitea workflow only produces amd64 .debs, so pin the image platform.
# On non-amd64 hosts (e.g. Apple Silicon) Docker will emulate via qemu.
FROM --platform=linux/amd64 debian:bookworm-slim
ARG GITEA_URL=https://gitea.cstudio.ch
ARG GITEA_OWNER=mike
ARG GITEA_REPO=rustdesk-server
ARG GITEA_BRANCH=pro-features
# When set, the script downloads this URL directly and skips API discovery.
ARG ARTIFACT_URL=
ARG CACHE_BUST=$(date +%s)
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
@@ -25,12 +16,8 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/*
COPY fetch-artifact.sh /usr/local/sbin/fetch-artifact.sh
RUN chmod +x /usr/local/sbin/fetch-artifact.sh
RUN echo "cache-bust=$CACHE_BUST" \
&& GITEA_URL="$GITEA_URL" GITEA_OWNER="$GITEA_OWNER" GITEA_REPO="$GITEA_REPO" \
GITEA_BRANCH="$GITEA_BRANCH" ARTIFACT_URL="$ARTIFACT_URL" \
/usr/local/sbin/fetch-artifact.sh
COPY entrypoint.sh /usr/local/sbin/entrypoint.sh
RUN chmod +x /usr/local/sbin/fetch-artifact.sh /usr/local/sbin/entrypoint.sh
WORKDIR /var/lib/rustdesk-server
@@ -38,5 +25,5 @@ WORKDIR /var/lib/rustdesk-server
# 21118 web socket signal, 21119 web socket relay.
EXPOSE 21114 21115 21116 21116/udp 21117 21118 21119
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["/usr/bin/hbbs"]
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/sbin/entrypoint.sh"]
CMD ["hbbs"]
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Runtime entrypoint: pulls the latest .deb artifact from Gitea Actions and
# installs it on every container start, then execs the CMD (hbbs / hbbr).
#
# Configuration comes from the environment — see docker-compose.yml:
# ARTIFACT_URL pinned zip URL; if unset the script discovers the newest
# successful run on GITEA_BRANCH
# GITEA_URL, GITEA_OWNER, GITEA_REPO, GITEA_BRANCH
# required when ARTIFACT_URL is unset
#
# Container fails to start if the fetch fails — that's intentional: we always
# want a fresh artifact, never a stale one.
set -euo pipefail
/usr/local/sbin/fetch-artifact.sh
exec "$@"