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