diff --git a/novnc/02-ssh.sh b/novnc/02-ssh.sh new file mode 100755 index 0000000..7ab7cb4 --- /dev/null +++ b/novnc/02-ssh.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# Check for client variables +if ! [ ${MYVNC_VNCSSH_HOST} ] +then + echo "Variable MYVNC_VNCSSH_HOST is missing." + echo "Exiting..." + exit 1 +fi +if ! [ ${MYVNC_VNCSSH_PORT} ] +then + echo "Variable MYVNC_VNCSSH_PORT is missing." + echo "Exiting..." + exit 1 +fi +if ! [[ ${MYVNC_VNCSSH_PORT} =~ ^[0-9]+$ ]] +then + echo "Variable MYVNC_VNCSSH_PORT is invalid." + echo "Exiting..." + exit 1 +fi + +# Read ssh client variables hostname and port (5900, 5901, 5902, etc) +ssh ${MYVNC_VNCSSH_HOST} -L ${MYVNC_VNCLISTEN_PORT:-5900}:localhost:${MYVNC_VNCSSH_PORT} & diff --git a/novnc/Dockerfile b/novnc/Dockerfile index 0d26717..2602bf5 100644 --- a/novnc/Dockerfile +++ b/novnc/Dockerfile @@ -2,39 +2,17 @@ FROM myvnc/base USER root -# Build ARG for additional packages to install (eg, openssh) -ARG addpkg +# Build ARG: use "root" for debugging +ARG debug # Install ssh client RUN apk update \ && apk upgrade \ && apk add --no-cache \ - openssh-client \ - && <<-'01-init' cat >>/app/init.d/01-init.sh + openssh-client -# Check for client variables -if ! [ ${MYVNC_VNCSSH_HOST} ] -then - echo "Variable MYVNC_VNCSSH_HOST is missing." - echo "Exiting..." - exit 1 -fi -if ! [ ${MYVNC_VNCSSH_PORT} ] -then - echo "Variable MYVNC_VNCSSH_PORT is missing." - echo "Exiting..." - exit 1 -fi -if ! [[ ${MYVNC_VNCSSH_PORT} =~ ^[0-9]+$ ]] -then - echo "Variable MYVNC_VNCSSH_PORT is invalid." - echo "Exiting..." - exit 1 -fi - -# Read ssh client variables hostname and port (5900, 5901, 5902, etc) -ssh ${MYVNC_VNCSSH_HOST} -L ${MYVNC_VNCLISTEN_PORT:-5900}:localhost:${MYVNC_VNCSSH_PORT} & -01-init +# Tigervnc +COPY *.sh /app/init.d/ # Default environment USER ${debug:-user} diff --git a/plasma/Dockerfile b/plasma/Dockerfile index 01d1b6e..7d50af3 100644 --- a/plasma/Dockerfile +++ b/plasma/Dockerfile @@ -32,7 +32,7 @@ RUN --mount=type=cache,sharing=locked,target=/var/cache/pacman \ # https://github.com/NVIDIA/nvidia-container-runtime#environment-variables-oci-spec ENV NVIDIA_VISIBLE_DEVICES=all ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility - + # Default environment USER user WORKDIR /home/user @@ -42,4 +42,4 @@ ENV SHELL=/usr/bin/bash ENV PS1="[\u@\h \W \$?]\$ " # Docker entrypoint -ENTRYPOINT ["/entrypoint"] \ No newline at end of file +ENTRYPOINT ["/entrypoint"] diff --git a/remmina/20-remmina.sh b/remmina/20-remmina.sh deleted file mode 100755 index 75ca135..0000000 --- a/remmina/20-remmina.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -# Remmina config -cat >~/.config/i3/config.d/remmina.conf <<- 'remmina.conf' -# Open terminal -exec --no-startup-id i3-msg 'workspace "2"; exec ${TERMINAL}' - -# Maximize -for_window [class="remmina"] move container to workspace "1" -for_window [class="${TERMINAL}"] move container to workspace "2" -remmina.conf - -# Remmina startup -install /dev/stdin ~/.config/i3/startapp.sh <<- startapp.sh -#!/usr/bin/env bash -# Run remmina -while true -do - remmina -done -startapp.sh diff --git a/remmina/Dockerfile b/remmina/Dockerfile deleted file mode 100644 index efe6c88..0000000 --- a/remmina/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -# syntax = docker/dockerfile:1 -FROM myvnc/base:i3 -USER root - -# Choose a terminal -ENV TERMINAL=xterm - -# Install packages -RUN apk add --no-cache \ - openssh \ - remmina \ - ${TERMINAL} - -# Tigervnc -COPY *.sh /app/init.d/ -RUN chmod +x /app/init.d/* - -# Reset user home directory -USER user -WORKDIR /home/user diff --git a/remmina/build b/remmina/build deleted file mode 100755 index 2bf2590..0000000 --- a/remmina/build +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -# Docker build -# Optional buildtag -DOCKER_BUILDKIT=1 docker build . \ - --tag ${buildtag:-myvnc/remmina} \ No newline at end of file diff --git a/remmina/docker-compose.yaml b/remmina/docker-compose.yaml deleted file mode 100644 index 0fb1d9c..0000000 --- a/remmina/docker-compose.yaml +++ /dev/null @@ -1,18 +0,0 @@ -services: - remmina: - image: myvnc/remmina - container_name: remmina - restart: unless-stopped - ports: - - ${MYVNC_REMMINA_PORT}:6900 - environment: - MYVNC_CUSTOM_TITLE: ${MYVNC_REMMINA_CUSTOM_TITLE} - MYVNC_VNCPASS: ${MYVNC_REMMINA_VNCPASS} - MYVNC_PROXYPATH: ${MYVNC_REMMINA_PROXYPATH} - MYVNC_VNCSHARING: ${MYVNC_REMMINA_VNCSHARING} - networks: - - remmina - -networks: - remmina: - external: false \ No newline at end of file