-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,17 +5,19 @@ | |
# ---------------------------------- | ||
FROM alpine as helper | ||
Check warning on line 6 in Dockerfile GitHub Actions / Docker push forThe 'as' keyword should match the case of the 'from' keyword
|
||
ARG KEEPUP_VERSION='3.1.1' | ||
RUN wget -nv -q -O keepup https://github.com/MineInAbyss/Keepup/releases/download/v${KEEPUP_VERSION}/keepup | ||
RUN wget -nv -q -O keepup https://github.com/MineInAbyss/Keepup/releases/download/v${KEEPUP_VERSION}/keepup \ | ||
&& chmod +x keepup | ||
# Install YourKit Java Profiler agents | ||
#RUN wget -q https://www.yourkit.com/download/docker/YourKit-JavaProfiler-2023.9-docker.zip -P /tmp/ && \ | ||
# unzip /tmp/YourKit-JavaProfiler-2023.9-docker.zip -d /usr/local && \ | ||
|
||
|
||
FROM itzg/minecraft-server:java21-graalvm as minecraft | ||
FROM container-registry.oracle.com/graalvm/jdk:23 as minecraft | ||
Check warning on line 14 in Dockerfile GitHub Actions / Docker push forThe 'as' keyword should match the case of the 'from' keyword
Check warning on line 14 in Dockerfile GitHub Actions / Docker push forThe 'as' keyword should match the case of the 'from' keyword
|
||
LABEL org.opencontainers.image.authors="Offz <[email protected]>" | ||
RUN dnf install -y ansible-core rclone wget unzip jq openssh attr | ||
#RUN dnf install -y ansible-core rclone wget unzip jq openssh attr | ||
RUN microdnf install --refresh -y oracle-epel-release-el9 && \ | ||
microdnf install -y ansible-core rclone wget unzip jq openssh attr file | ||
|
||
COPY --from=helper /keepup /usr/local/bin | ||
RUN chmod +x /usr/local/bin/keepup | ||
ENV\ | ||
KEEPUP=true\ | ||
KEEPUP_ALLOW_OVERRIDES=true\ | ||
|
@@ -25,27 +27,31 @@ ENV\ | |
SERVER_NAME=dev\ | ||
HOME=/data\ | ||
ANSIBLE_CONFIG=/server-config/ansible.cfg\ | ||
LC_ALL=C.UTF-8 | ||
LC_ALL=C.UTF-8\ | ||
UID=1000\ | ||
GID=1000 | ||
|
||
# Install ansible collections | ||
COPY config/ansible-requirements.yml /opt/ansible/requirements.yml | ||
RUN ansible-galaxy collection install -r /opt/ansible/requirements.yml -p /opt/ansible/collections \ | ||
&& rm /opt/ansible/requirements.yml | ||
|
||
# Copy over scripts | ||
COPY scripts/dev /scripts/dev | ||
RUN chmod +x /scripts/dev/* | ||
COPY scripts /scripts | ||
RUN chmod +x /scripts/* | ||
|
||
RUN groupadd --gid 1000 minecraft && \ | ||
useradd --system --shell /bin/false --uid 1000 -g minecraft --home /data minecraft | ||
|
||
WORKDIR $HOME | ||
ENTRYPOINT ["/scripts/dev/entrypoint"] | ||
ENTRYPOINT ["/scripts/entrypoint"] | ||
|
||
|
||
FROM itzg/bungeecord as proxy | ||
Check warning on line 50 in Dockerfile GitHub Actions / Docker push forThe 'as' keyword should match the case of the 'from' keyword
Check warning on line 50 in Dockerfile GitHub Actions / Docker push forThe 'as' keyword should match the case of the 'from' keyword
|
||
LABEL org.opencontainers.image.authors="Offz <[email protected]>" | ||
RUN apt-get update -y \ | ||
&& apt-get install -y rsync rclone wget unzip git pipx python3-venv jq file | ||
COPY --from=helper /keepup /usr/local/bin | ||
RUN chmod +x /usr/local/bin/keepup | ||
ENV\ | ||
KEEPUP=true\ | ||
KEEPUP_ALLOW_OVERRIDES=true\ | ||
|
@@ -64,9 +70,9 @@ RUN ansible-galaxy collection install -r /opt/ansible/requirements.yml -p /opt/a | |
&& rm /opt/ansible/requirements.yml | ||
|
||
# Copy over scripts | ||
COPY scripts/dev /scripts/dev | ||
RUN chmod +x /scripts/dev/* | ||
COPY scripts /scripts | ||
RUN chmod +x /scripts/* | ||
|
||
WORKDIR $HOME | ||
RUN cp /usr/bin/run-bungeecord.sh /start | ||
ENTRYPOINT ["/scripts/dev/entrypoint"] | ||
ENTRYPOINT ["/scripts/entrypoint"] |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
usermod -u $UID minecraft | ||
groupmod -o -g "$GID" minecraft | ||
|
||
if [ "$UPDATE_DATA_OWNER" = "true" ]; then | ||
echo "[Init] Updating owner for /data and /server-config to $UID:$GID" | ||
chown $UID:$GID -R /data | ||
chown $UID:$GID -R /server-config | ||
fi | ||
|
||
exec setpriv --reuid $UID --regid $GID --init-groups --inh-caps=-all /scripts/rootless |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
echo [Init] Running scripts as user: $(whoami) | ||
|
||
. /scripts/ansible | ||
. /scripts/keepup | ||
. /scripts/download_server | ||
|
||
# If /start exists | ||
if [ -f /start ]; then | ||
exec /start | ||
else | ||
exec java $JVM_XX_OPTS $JVM_OPTS $expandedDOpts -jar "$(basename "${CUSTOM_SERVER}")" "$@" $EXTRA_ARGS | ||
fi |