changes docker build

This commit is contained in:
David Claeys
2026-01-27 09:10:14 +01:00
parent fd3fc34644
commit 6a670a7f2b
2 changed files with 32 additions and 19 deletions

View File

@@ -1,12 +1,21 @@
FROM debian:bookworm FROM debian:bookworm
COPY start.sh .
RUN export DEBIAN_FRONTEND=noninteractive && \ RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \ apt-get update && \
apt-get upgrade -y -q && \ apt-get upgrade -y -q && \
apt-get install -y wget gpg sudo libpython3.9 && \ apt-get install -y wget curl sudo gpg apt-transport-https lsb-release && \
wget -qO /tmp/install.sh https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/docker-compile.sh && \ wget -qO /tmp/hyperion.pub.key https://releases.hyperion-project.org/hyperion.pub.key && \
chmod +x /tmp/install.sh && \ gpg --dearmor -o /usr/share/keyrings/hyperion.pub.gpg /tmp/hyperion.pub.key && \
apt-get clean echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hyperion.pub.gpg] https://apt.releases.hyperion-project.org/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/hyperion.list && \
apt-get update && \
apt-get install -y hyperion && \
groupadd -f hyperion && \
useradd -r -s /bin/bash -g hyperion hyperion && \
chmod 777 /start.sh && \
mkdir /config && \
apt-get clean && \
rm -rf /var/cache/apk/*
# Flatbuffers Server port # Flatbuffers Server port
@@ -31,18 +40,5 @@ EXPOSE 8092
ENV UID=1000 ENV UID=1000
ENV GID=1000 ENV GID=1000
RUN groupadd -f hyperion SHELL ["/bin/bash", "-c"]
RUN useradd -r -s /bin/bash -g hyperion hyperion ENTRYPOINT bash start.sh uid="$UID" gid="$GID"
RUN bash /tmp/install.sh
RUN echo "#!/bin/bash" > /start.sh
RUN echo "groupmod -g \$2 hyperion" >> /start.sh
RUN echo "usermod -u \$1 hyperion" >> /start.sh
RUN echo "chown -R hyperion:hyperion /config" >> /start.sh
RUN echo "sudo -u hyperion /usr/bin/hyperiond -v --service -u /config" >> /start.sh
RUN chmod 777 /start.sh
VOLUME /config
CMD [ "bash", "-c", "/start.sh ${UID} ${GID}" ]

17
start.sh Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# Loop through arguments
for arg in "$@"; do
case "$arg" in
uid=*) uid="${arg#*=}" ;;
gid=*) gid="${arg#*=}" ;;
esac
done
groupmod -g $gid hyperion
usermod -u $uid hyperion
ln -s /root/.hyperion /config
chown -R hyperion:hyperion /config
sudo -u hyperion /usr/bin/hyperiond -v --service --userdata /config
hyperiond -i