FROM debian:buster-slim

ENV STARTUPDIR=/dockerstartup

COPY ./builder/scripts/ /tmp/scripts/
COPY ./debian/changelog /tmp

ARG KASMVNC_PACKAGE_DIR
COPY $KASMVNC_PACKAGE_DIR/kasmvncserver_*.deb /tmp/
RUN /tmp/scripts/install_kasmvncserver_package
RUN apt-get update && apt-get -y install xterm

RUN mkdir -p $STARTUPDIR
COPY builder/startup/vnc_startup_barebones.sh $STARTUPDIR

RUN useradd -m foo
USER foo:ssl-cert

ENTRYPOINT "/$STARTUPDIR/vnc_startup_barebones.sh"
