feat(release): reduce image size by running autoremove, clean and removing lists (#6267)

This commit is contained in:
Justin Keller
2025-10-27 13:12:53 +01:00
committed by GitHub
parent c3a62f7461
commit 93945606ea
3 changed files with 27 additions and 13 deletions
+8 -3
View File
@@ -70,7 +70,10 @@ RUN apt update \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt --yes --no-install-recommends install git
&& apt --yes --no-install-recommends install git \
&& apt autoremove -y --purge \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
## Empty the directory, because we have to clone the Git repo.
RUN rm -rf ./* && chown node /app
@@ -95,7 +98,10 @@ CMD ["npm", "run", "start-pr-test"]
FROM louislam/uptime-kuma:base2 AS upload-artifact
WORKDIR /
RUN apt update && \
apt --yes install curl file
apt --yes install curl file && \
apt autoremove -y --purge && \
apt clean && \
rm -rf /var/lib/apt/lists/*
COPY --from=build /app /app
@@ -115,4 +121,3 @@ RUN chmod +x /app/extra/upload-github-release-asset.sh
# Dist only
RUN cd /app && tar -zcvf $DIST dist
RUN /app/extra/upload-github-release-asset.sh github_api_token=$GITHUB_TOKEN owner=louislam repo=uptime-kuma tag=$VERSION filename=/app/$DIST