Daily Post Image from Upsplash

May: 19

2024

VNC

The VNC adventure still continues and this time we are going to switch over to kasm! I really wanted to make my own based upon the vnc format but kasm is growing so fast and it provides almost everything that I need, it just makes sense to build ontop of it.

We did a couple moch images earlier this morning but I am ready to build it all again. Furthermore, I think we should update the notes from just rustdesk to something more along the realm of either vnc or RDP. Creating a new application document to keep track of everything would make sense and it should be a habit that I need to practice more often.

FROM lscr.io/linuxserver/chromium:latest

RUN apt-get update && \
    apt-get install -y \
    wget \
    python3 \
    python3-pip \
    python3-tk \
    python3-xdg \
    python3-dev \
    python3-venv \
    python3-distutils \
    pulseaudio

RUN ln -s /usr/bin/python3 /usr/bin/python

RUN wget -O /usr/local/bin/runelite.jar https://github.com/runelite/launcher/releases/download/2.7.1/RuneLite.jar

RUN curl -sSL https://install.python-poetry.org | python -

ENV PATH="$HOME/.local/bin:$HOME/.poetry/bin:${PATH}"

RUN poetry --version

WORKDIR /app
COPY . /app
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh

RUN mkdir -p /var/run/pulse && \
    pulseaudio --daemonize && \
    pulseaudio --start

RUN poetry install

ENV PATH="/app/.venv/bin:$PATH"

EXPOSE 3000 8086

I am going to keep a backup of the older dockerfile in this journal entry, so that I can reference it back again in the future.

I really wish I did not have to go on multiple quests to just get these small errors resolved. This makes me really hate Ubuntu, Python and their whole eco-system, way too many random configurations and not enough easy fallbacks.

Docker

When deploying the Dockerfile , we can pass the shim using docker run -it --shm-size=256m , the --shm-size flag. To run the application, we will use:

docker run --name myapp_container -d -p 3000:3000 -p 8086:8086 --shm-size=2g myapp

This will open the two ports that we need and set the shm-size to 2G.

Hmm, so we have two options:

The —no-sandbox option is required, or —cap-add=SYS_ADMIN to docker run command

Here is a quick chain command:

docker build . -t myapp && docker stop myapp_container && docker run --name myapp_container -d -p 3000:3000 -p 8086:8086 --shm-size=2g myapp