Refactor Dockerfile and custom_startup.sh for improved Forge installation and startup process
All checks were successful
Build & Push Forge-Kasm / docker (push) Successful in 1m44s

This commit is contained in:
2025-06-05 10:50:24 -05:00
parent f2b5df2974
commit 60881ced15
2 changed files with 24 additions and 6 deletions

View File

@@ -1,14 +1,15 @@
ARG BASE_TAG="develop"
ARG BASE_IMAGE="core-ubuntu-jammy"
FROM kasmweb/${BASE_IMAGE}:${BASE_TAG}
FROM kasmweb/$BASE_IMAGE:$BASE_TAG
USER root
ENV HOME /home/kasm-default-profile
ENV STARTUPDIR /dockerstartup
ENV INST_SCRIPTS $STARTUPDIR/install
WORKDIR $HOME
######### Customize Container Here ###########
### Install Java 17
RUN apt-get update && \
apt-get install -y openjdk-17-jdk && \
@@ -28,11 +29,20 @@ RUN apt-get update && apt-get install -y jq curl && \
apt-get autoremove -y
### Add the startup script
COPY custom_startup.sh $STARTUPDIR/custom_startup.sh
COPY ./custom_startup.sh $STARTUPDIR/custom_startup.sh
RUN chmod +x $STARTUPDIR/custom_startup.sh
RUN chmod 755 $STARTUPDIR/custom_startup.sh
### Optional: Single app UI tweaks
RUN cp $HOME/.config/xfce4/xfconf/single-application-xfce-perchannel-xml/* \
$HOME/.config/xfce4/xfconf/xfce-perchannel-xml/
USER 1000
######### End Customizations ###########
RUN chown 1000:0 $HOME
ENV HOME /home/kasm-user
WORKDIR $HOME
RUN mkdir -p $HOME && chown -R 1000:0 $HOME
USER 1000

View File

@@ -1,5 +1,13 @@
#!/bin/bash
set -e
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
/opt/forge/start.sh
# Optional: maximize Forge window
if [[ -x $STARTUPDIR/maximize_window.sh ]]; then
bash $STARTUPDIR/maximize_window.sh &
fi
# Run Forge and wait for it to close
exec /opt/forge/start.sh