Refactor Dockerfile and custom startup script for improved Forge installation and execution
All checks were successful
Build & Push Forge-Kasm / docker (push) Successful in 31s
All checks were successful
Build & Push Forge-Kasm / docker (push) Successful in 31s
This commit is contained in:
@@ -16,7 +16,7 @@ RUN apt-get update && \
|
|||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
### Install Forge
|
### Install Forge to /opt/forge, placing the start file at /opt/forge/forge.sh
|
||||||
WORKDIR /tmp/forge-download
|
WORKDIR /tmp/forge-download
|
||||||
RUN apt-get update && apt-get install -y jq curl && \
|
RUN apt-get update && apt-get install -y jq curl && \
|
||||||
SNAPSHOT_URL=$(curl -s https://api.github.com/repos/Card-Forge/forge/releases/tags/daily-snapshots \
|
SNAPSHOT_URL=$(curl -s https://api.github.com/repos/Card-Forge/forge/releases/tags/daily-snapshots \
|
||||||
@@ -29,7 +29,7 @@ RUN apt-get update && apt-get install -y jq curl && \
|
|||||||
apt-get autoremove -y
|
apt-get autoremove -y
|
||||||
|
|
||||||
### Add the startup script
|
### Add the startup script
|
||||||
COPY custom_startup $STARTUPDIR/custom_startup.sh
|
COPY custom_startup.sh $STARTUPDIR/custom_startup.sh
|
||||||
RUN chmod +x $STARTUPDIR/custom_startup.sh
|
RUN chmod +x $STARTUPDIR/custom_startup.sh
|
||||||
RUN chmod 755 $STARTUPDIR/custom_startup.sh
|
RUN chmod 755 $STARTUPDIR/custom_startup.sh
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
|
|
||||||
export PATH=$JAVA_HOME/bin:$PATH
|
|
||||||
|
|
||||||
# Optional: maximize Forge window
|
|
||||||
if [[ -x $STARTUPDIR/maximize_window.sh ]]; then
|
|
||||||
bash $STARTUPDIR/maximize_window.sh &
|
|
||||||
fi
|
|
||||||
|
|
||||||
# DEBUG: Create a file on desktop to indicate the script is running
|
|
||||||
if [[ -d $HOME/Desktop ]]; then
|
|
||||||
echo "Forge startup script is running" > $HOME/Desktop/forge_startup.log
|
|
||||||
else
|
|
||||||
echo "Forge startup script is running" > $HOME/forge_startup.log
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Run Forge and wait for it to close
|
|
||||||
exec /opt/forge/start.sh
|
|
||||||
13
custom_startup.sh
Normal file
13
custom_startup.sh
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
|
||||||
|
export PATH=$JAVA_HOME/bin:$PATH
|
||||||
|
|
||||||
|
# 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/forge.sh
|
||||||
Reference in New Issue
Block a user