convert to "rootless"
All checks were successful
Docker Build and Push / build (push) Successful in 1m14s

This commit is contained in:
Jeremy McClure 2025-03-29 04:08:02 -04:00
parent e6b309d047
commit 2037324375
Signed by: jeremy
GPG Key ID: CA27BD8443157067

View File

@ -1,32 +1,36 @@
FROM ubuntu:noble
ARG UID=1000
ARG GID=1000
ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# install prerequisites
RUN apt update \
&& apt install -y --no-install-recommends \
curl ca-certificates \
jq \
libxml2-utils \
&& apt autoremove \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
ca-certificates \
jq \
libxml2-utils \
sudo && \
apt-get autoremove && apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Remove default ubuntu user
RUN userdel -r ubuntu \
&& useradd --create-home -u 1000 minecraft \
&& mkdir -p /data \
&& chown -R 1000:1000 /data
RUN userdel -r ubuntu && \
useradd --create-home -u 1000 minecraft && \
echo 'minecraft ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \
mkdir -p /data && \
chown -R ${UID}:${GID} /data
USER minecraft
RUN curl -sL https://github.com/Jabba-Team/jabba/raw/main/install.sh | bash \
&& . ~/.jabba/jabba.sh
USER root
RUN su -c "curl -sL https://github.com/Jabba-Team/jabba/raw/main/install.sh | bash && . ~/.jabba/jabba.sh" minecraft
COPY ./scripts/init /
COPY ./scripts/mc /usr/local/bin
RUN chmod +x /init && chmod +x /usr/local/bin/mc
CMD ["/init"]
USER minecraft
CMD ["/init"]