Skip to content

Commit

Permalink
add kasm network support
Browse files Browse the repository at this point in the history
  • Loading branch information
thelamer committed Jun 27, 2024
1 parent 2d0667a commit 09bf8df
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM node:12-buster as wwwstage
FROM node:12-buster AS wwwstage

ARG KASMWEB_RELEASE="5ba4695e6526a27b8e38ec8d55dc33b39143e68a"

Expand All @@ -27,7 +27,7 @@ RUN \
cp index.html vnc.html && \
mkdir Downloads

FROM ghcr.io/linuxserver/baseimage-alpine:3.20 as buildstage
FROM ghcr.io/linuxserver/baseimage-alpine:3.20 AS buildstage

ARG KASMVNC_RELEASE="511e2ae542e95f5447a0a145bb54ced968e6cfec"

Expand Down Expand Up @@ -193,7 +193,7 @@ RUN \
-C /build-out/

# nodejs builder
FROM ghcr.io/linuxserver/baseimage-alpine:3.20 as nodebuilder
FROM ghcr.io/linuxserver/baseimage-alpine:3.20 AS nodebuilder
ARG KCLIENT_RELEASE

RUN \
Expand Down Expand Up @@ -271,6 +271,7 @@ RUN \
fuse-overlayfs \
gcompat \
intel-media-driver \
iproute2-minimal \
lang \
libgcc \
libgomp \
Expand Down Expand Up @@ -368,6 +369,7 @@ RUN \
chmod +x /kasmbins/* && \
chown -R 1000:1000 /kasmbins && \
chown 1000:1000 /usr/share/kasmvnc/www/Downloads && \
mkdir -p /dockerstartup && \
echo "**** dind support ****" && \
addgroup -S dockremap && \
adduser -S -G dockremap dockremap && \
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM node:12-buster as wwwstage
FROM node:12-buster AS wwwstage

ARG KASMWEB_RELEASE="5ba4695e6526a27b8e38ec8d55dc33b39143e68a"

Expand Down Expand Up @@ -32,7 +32,7 @@ RUN \
cp index.html vnc.html && \
mkdir Downloads

FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.20 as buildstage
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.20 AS buildstage

ARG KASMVNC_RELEASE="511e2ae542e95f5447a0a145bb54ced968e6cfec"

Expand Down Expand Up @@ -205,7 +205,7 @@ RUN \
-C /build-out/

# nodejs builder
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.20 as nodebuilder
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.20 AS nodebuilder
ARG KCLIENT_RELEASE

RUN \
Expand Down Expand Up @@ -282,6 +282,7 @@ RUN \
font-noto-emoji \
fuse-overlayfs \
gcompat \
iproute2-minimal \
lang \
libgcc \
libgomp \
Expand Down Expand Up @@ -372,6 +373,7 @@ RUN \
chmod +x /kasmbins/* && \
chown -R 1000:1000 /kasmbins && \
chown 1000:1000 /usr/share/kasmvnc/www/Downloads && \
mkdir -p /dockerstartup && \
echo "**** dind support ****" && \
addgroup -S dockremap && \
adduser -S -G dockremap dockremap && \
Expand Down
29 changes: 29 additions & 0 deletions root/kasminit
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,35 @@ elif ! diff -q /proot-apps/pversion ${HOME}/.local/bin/pversion > /dev/null; the
cp /proot-apps/* ${HOME}/.local/bin/
fi

## Network egress wait ##
while :; do
interfaces=$(ip link show type veth | awk -F: '/^[0-9]+: / {print $2}' | awk '{print $1}' | sed 's/@.*//')
if [ -z "$interfaces" ]; then
sleep 1
continue
fi
for interface in $interfaces; do
if [[ $interface == eth* ]]; then
break 2
fi
if [[ $interface == k-p-* ]]; then
egress_file="/dockerstartup/.egress_status"
while [ ! -f "$egress_file" ]; do
sleep 1
done
egress_status=$(cat $egress_file)
if [ "$egress_status" == "ready" ]; then
break 2
fi
if [ "$egress_status" == "error" ]; then
echo "Failed to establish egress gateway. Exiting..."
exit 1
fi
fi
done
sleep 1
done

## KasmVNC init ##
# Password
if [[ -f $HOME/.kasmpasswd ]]; then
Expand Down

0 comments on commit 09bf8df

Please sign in to comment.