diff --git a/Dockerfile b/Dockerfile index 5690c13..c0b09aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,39 @@ -FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbookworm-12c6f55b-ls87 AS buildstage +# taken from https://github.com/linuxserver/docker-baseimage-kasmvnc/blob/debianbookworm/Dockerfile +# modified to apply 'novnc.patch' (fixing a disconnect/reconnect issue) +FROM node:12-buster AS wwwstage + +ARG KASMWEB_RELEASE="5ba4695e6526a27b8e38ec8d55dc33b39143e68a" + +RUN \ + echo "**** build clientside ****" && \ + mkdir /src && \ + cd /src && \ + wget https://github.com/kasmtech/noVNC/tarball/${KASMWEB_RELEASE} -O - \ + | tar --strip-components=1 -xz + +COPY ./patches/novnc.patch /src/ +RUN \ + export QT_QPA_PLATFORM=offscreen && \ + export QT_QPA_FONTDIR=/usr/share/fonts && \ + echo "apply novnc.patch" && \ + cd /src && \ + patch -p1 -i novnc.patch && \ + npm install && \ + npm run-script build + +RUN \ + echo "**** organize output ****" && \ + mkdir /build-out && \ + cd /src && \ + rm -rf node_modules/ && \ + cp -R ./* /build-out/ && \ + cd /build-out && \ + rm *.md && \ + rm AUTHORS && \ + cp index.html vnc.html && \ + mkdir Downloads + +FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbookworm-f7a8978f-ls89 AS buildstage # these are specified in Makefile ARG ARCH @@ -104,6 +139,7 @@ RUN \ FROM scratch COPY --from=buildstage / . +COPY --from=wwwstage /build-out /usr/local/share/kasmvnc/www # since we start from scratch, we need these env variables from the base images ENV \ diff --git a/Makefile b/Makefile index 50a0b0e..c5d130a 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ PKG_VERSION := $(shell yq e ".version" manifest.yaml) TS_FILES := $(shell find ./ -name \*.ts) ROOT_FILES := $(shell find ./root) ASSET_FILES := $(shell find ./assets/compat) +PATCH_FILES := $(shell find ./patches) .DELETE_ON_ERROR: @@ -37,7 +38,7 @@ clean: scripts/embassy.js: $(TS_FILES) deno bundle scripts/embassy.ts scripts/embassy.js -docker-images/x86_64.tar: manifest.yaml Dockerfile docker_entrypoint.sh $(ROOT_FILES) +docker-images/x86_64.tar: manifest.yaml Dockerfile docker_entrypoint.sh $(ROOT_FILES) $(PATCH_FILES) mkdir -p docker-images docker buildx build --tag start9/$(PKG_ID)/main:$(PKG_VERSION) \ --build-arg ARCH=x86_64 \ diff --git a/docker_entrypoint.sh b/docker_entrypoint.sh index a008542..88ec49f 100755 --- a/docker_entrypoint.sh +++ b/docker_entrypoint.sh @@ -133,6 +133,13 @@ EOF fi fi +# remove reference to non-existing file, see: https://github.com/linuxserver/kclient/issues/8 +sed -i '/