feat: Add webbased VNC viewer (#306)
This commit is contained in:
parent
f54ef967c7
commit
003181333c
4 changed files with 21 additions and 12 deletions
|
@ -2,18 +2,21 @@ FROM debian:trixie-slim
|
|||
|
||||
ARG DEBCONF_NOWARNINGS="yes"
|
||||
ARG DEBIAN_FRONTEND noninteractive
|
||||
ARG DEBCONF_NONINTERACTIVE_SEEN true
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get --no-install-recommends -y install \
|
||||
tini \
|
||||
wget \
|
||||
ovmf \
|
||||
novnc \
|
||||
procps \
|
||||
iptables \
|
||||
iproute2 \
|
||||
dnsmasq \
|
||||
net-tools \
|
||||
qemu-utils \
|
||||
websockify \
|
||||
ca-certificates \
|
||||
netcat-openbsd \
|
||||
qemu-system-x86 \
|
||||
|
@ -24,7 +27,7 @@ COPY ./src /run/
|
|||
RUN chmod +x /run/*.sh
|
||||
|
||||
VOLUME /storage
|
||||
EXPOSE 22 5900
|
||||
EXPOSE 22 5900 8006
|
||||
|
||||
ENV CPU_CORES "1"
|
||||
ENV RAM_SIZE "1G"
|
||||
|
|
|
@ -16,6 +16,11 @@ cd /run
|
|||
. config.sh # Configure arguments
|
||||
|
||||
trap - ERR
|
||||
|
||||
if [[ "${DISPLAY,,}" == "vnc" ]]; then
|
||||
websockify -D --web /usr/share/novnc/ 8006 localhost:5900
|
||||
fi
|
||||
|
||||
info "Booting image using $VERS..."
|
||||
|
||||
[[ "$DEBUG" == [Yy1]* ]] && set -x
|
||||
|
|
|
@ -1,16 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
BASE="boot.img"
|
||||
[ -f "$STORAGE/$BASE" ] && return 0
|
||||
|
||||
if [ -z "$BOOT" ]; then
|
||||
error "No boot disk specified, set BOOT= to the URL of an ISO file." && exit 64
|
||||
fi
|
||||
|
||||
BASE=$(basename "$BOOT")
|
||||
[ -f "$STORAGE/$BASE" ] && return 0
|
||||
|
||||
# Check if running with interactive TTY or redirected to docker log
|
||||
if [ -t 1 ]; then
|
||||
PROGRESS="--progress=bar:noscroll"
|
||||
|
@ -34,6 +24,16 @@ if [[ "${BOOT_MODE,,}" == "windows" ]]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
BASE="boot.img"
|
||||
[ -f "$STORAGE/$BASE" ] && return 0
|
||||
|
||||
if [ -z "$BOOT" ]; then
|
||||
error "No boot disk specified, set BOOT= to the URL of an ISO file." && exit 64
|
||||
fi
|
||||
|
||||
BASE=$(basename "$BOOT")
|
||||
[ -f "$STORAGE/$BASE" ] && return 0
|
||||
|
||||
TMP="$STORAGE/${BASE%.*}.tmp"
|
||||
rm -f "$TMP"
|
||||
|
||||
|
|
|
@ -95,9 +95,10 @@ getPorts() {
|
|||
|
||||
local list=$1
|
||||
local vnc="5900"
|
||||
local novnc="8006"
|
||||
|
||||
if [[ "${DISPLAY,,}" == "vnc" ]] && [[ "$list" != *"$vnc"* ]]; then
|
||||
[ -z "$list" ] && list="$vnc" || list="$list,$vnc"
|
||||
[ -z "$list" ] && list="$vnc,$novnc" || list="$list,$vnc,$novnc"
|
||||
fi
|
||||
|
||||
[ -z "$list" ] && return 0
|
||||
|
|
Loading…
Reference in a new issue