Minor updates

This commit is contained in:
Myve 2024-07-24 00:00:16 +00:00
commit 8339e4b668
7 changed files with 30 additions and 92 deletions

23
novnc/02-ssh.sh Executable file
View file

@ -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} &

View file

@ -2,39 +2,17 @@
FROM myvnc/base FROM myvnc/base
USER root USER root
# Build ARG for additional packages to install (eg, openssh) # Build ARG: use "root" for debugging
ARG addpkg ARG debug
# Install ssh client # Install ssh client
RUN apk update \ RUN apk update \
&& apk upgrade \ && apk upgrade \
&& apk add --no-cache \ && apk add --no-cache \
openssh-client \ openssh-client
&& <<-'01-init' cat >>/app/init.d/01-init.sh
# Check for client variables # Tigervnc
if ! [ ${MYVNC_VNCSSH_HOST} ] COPY *.sh /app/init.d/
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
# Default environment # Default environment
USER ${debug:-user} USER ${debug:-user}

View file

@ -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 # https://github.com/NVIDIA/nvidia-container-runtime#environment-variables-oci-spec
ENV NVIDIA_VISIBLE_DEVICES=all ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
# Default environment # Default environment
USER user USER user
WORKDIR /home/user WORKDIR /home/user
@ -42,4 +42,4 @@ ENV SHELL=/usr/bin/bash
ENV PS1="[\u@\h \W \$?]\$ " ENV PS1="[\u@\h \W \$?]\$ "
# Docker entrypoint # Docker entrypoint
ENTRYPOINT ["/entrypoint"] ENTRYPOINT ["/entrypoint"]

View file

@ -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

View file

@ -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

View file

@ -1,5 +0,0 @@
#!/usr/bin/env bash
# Docker build
# Optional buildtag
DOCKER_BUILDKIT=1 docker build . \
--tag ${buildtag:-myvnc/remmina}

View file

@ -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