Skip to content

Commit

Permalink
Merge pull request #111 from mornedhels/feature/cleanup-docker-deps
Browse files Browse the repository at this point in the history
refactor: cleanup deps & added multistage build for proton container
  • Loading branch information
cp-fabian-pittroff authored Nov 10, 2024
2 parents a02ce08 + e416c00 commit 9f07644
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
3 changes: 0 additions & 3 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ LABEL maintainer="[email protected]"
# Install prerequisites
RUN apt-get update \
&& DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
cabextract \
curl \
winbind \
supervisor \
cron \
rsyslog \
jq \
lsof \
zip \
python3 \
python3-pip \
Expand Down
43 changes: 27 additions & 16 deletions dockerfiles/proton.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,43 @@
FROM steamcmd/steamcmd:ubuntu-24@sha256:1314c2ee778d3b7349a42b90745d688689e9a317dc405680be10e3cb537c9a85
LABEL maintainer="[email protected]"
FROM steamcmd/steamcmd:ubuntu-24@sha256:1314c2ee778d3b7349a42b90745d688689e9a317dc405680be10e3cb537c9a85 as builder

Check warning on line 1 in dockerfiles/proton.Dockerfile

View workflow job for this annotation

GitHub Actions / build-proton / Docker Build & Push

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 1 in dockerfiles/proton.Dockerfile

View workflow job for this annotation

GitHub Actions / build-proton / Docker Build & Push

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 1 in dockerfiles/proton.Dockerfile

View workflow job for this annotation

GitHub Actions / build-proton / Docker Build & Push

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

ARG GE_PROTON_VERSION="9-18"
ARG GE_PROTON_VERSION="9-19"

# Install prerequisites
RUN dpkg --add-architecture i386 \
&& apt-get update \
&& DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
cabextract \
curl \
winbind \
tar \
dbus \
&& apt autoremove --purge && apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# install proton
RUN curl -sLOJ "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton${GE_PROTON_VERSION}/GE-Proton${GE_PROTON_VERSION}.tar.gz" \
&& mkdir -p /tmp/proton \
&& tar -xzf GE-Proton*.tar.gz -C /tmp/proton --strip-components=1 \
&& rm GE-Proton*.* \
&& rm -f /etc/machine-id \
&& dbus-uuidgen --ensure=/etc/machine-id


FROM steamcmd/steamcmd:ubuntu-24@sha256:1314c2ee778d3b7349a42b90745d688689e9a317dc405680be10e3cb537c9a85
LABEL maintainer="[email protected]"

# Install dependencies
RUN dpkg --add-architecture i386 \
&& apt-get update \
&& DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
curl \
supervisor \
cron \
rsyslog \
jq \
lsof \
zip \
python3 \
python3-pip \
tar \
dbus \
libfreetype6 \
libfreetype6:i386 \
gnutls-bin \
&& apt autoremove --purge && apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Expand All @@ -31,13 +46,6 @@ RUN curl -o /tmp/winetricks https://raw.githubusercontent.com/Winetricks/winetri
&& chmod +x /tmp/winetricks && install -m 755 /tmp/winetricks /usr/local/bin/winetricks \
&& rm -rf /tmp/*

# install proton
RUN curl -sLOJ "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton${GE_PROTON_VERSION}/GE-Proton${GE_PROTON_VERSION}.tar.gz" \
&& tar -xzf GE-Proton*.tar.gz -C /usr/local/bin/ --strip-components=1 \
&& rm GE-Proton*.* \
&& rm -f /etc/machine-id \
&& dbus-uuidgen --ensure=/etc/machine-id

# MISC
RUN mkdir -p /usr/local/etc /var/log/supervisor /var/run/enshrouded /usr/local/etc/supervisor/conf.d/ /opt/enshrouded /home/enshrouded/.steam/sdk32 /home/enshrouded/.steam/sdk64 \
&& groupadd -g "${PGID:-4711}" -o enshrouded \
Expand All @@ -47,6 +55,9 @@ RUN mkdir -p /usr/local/etc /var/log/supervisor /var/run/enshrouded /usr/local/e
&& sed -i '/imklog/s/^/#/' /etc/rsyslog.conf \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY --from=builder /tmp/proton /usr/local/bin
COPY --from=builder /etc/machine-id /etc/machine-id

COPY ../supervisord.conf /etc/supervisor/supervisord.conf
COPY --chmod=755 ../scripts/default/* ../scripts/proton/* /usr/local/etc/enshrouded/

Expand Down

0 comments on commit 9f07644

Please sign in to comment.