mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-12-10 00:30:23 -06:00
Revert "feat(release): reduce image size by running autoremove, clean and removing lists" (#6268)
This commit is contained in:
parent
93945606ea
commit
f6a47f351c
@ -19,7 +19,4 @@ RUN apt update && \
|
|||||||
curl -sL https://deb.nodesource.com/setup_18.x | bash && \
|
curl -sL https://deb.nodesource.com/setup_18.x | bash && \
|
||||||
apt --yes --no-install-recommends install nodejs && \
|
apt --yes --no-install-recommends install nodejs && \
|
||||||
node ./extra/build-healthcheck.js $TARGETPLATFORM && \
|
node ./extra/build-healthcheck.js $TARGETPLATFORM && \
|
||||||
apt --yes remove nodejs && \
|
apt --yes remove nodejs
|
||||||
apt autoremove -y --purge && \
|
|
||||||
apt clean && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|||||||
@ -5,10 +5,7 @@ COPY ./extra/download-apprise.mjs ./download-apprise.mjs
|
|||||||
RUN apt update && \
|
RUN apt update && \
|
||||||
apt --yes --no-install-recommends install curl && \
|
apt --yes --no-install-recommends install curl && \
|
||||||
npm install cheerio semver && \
|
npm install cheerio semver && \
|
||||||
node ./download-apprise.mjs && \
|
node ./download-apprise.mjs
|
||||||
apt autoremove -y --purge && \
|
|
||||||
apt clean && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Base Image (Slim)
|
# Base Image (Slim)
|
||||||
# If the image changed, the second stage image should be changed too
|
# If the image changed, the second stage image should be changed too
|
||||||
@ -34,9 +31,8 @@ RUN apt update && \
|
|||||||
curl \
|
curl \
|
||||||
sudo \
|
sudo \
|
||||||
nscd && \
|
nscd && \
|
||||||
apt autoremove -y --purge && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
apt clean && \
|
apt --yes autoremove
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# apprise = for notifications (Install from the deb package, as the stable one is too old) (workaround for #4867)
|
# apprise = for notifications (Install from the deb package, as the stable one is too old) (workaround for #4867)
|
||||||
# Switching to testing repo is no longer working, as the testing repo is not bookworm anymore.
|
# Switching to testing repo is no longer working, as the testing repo is not bookworm anymore.
|
||||||
@ -45,10 +41,9 @@ RUN apt update && \
|
|||||||
COPY --from=download-apprise /app/apprise.deb ./apprise.deb
|
COPY --from=download-apprise /app/apprise.deb ./apprise.deb
|
||||||
RUN apt update && \
|
RUN apt update && \
|
||||||
apt --yes --no-install-recommends install ./apprise.deb python3-paho-mqtt && \
|
apt --yes --no-install-recommends install ./apprise.deb python3-paho-mqtt && \
|
||||||
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
rm -f apprise.deb && \
|
rm -f apprise.deb && \
|
||||||
apt autoremove -y --purge && \
|
apt --yes autoremove
|
||||||
apt clean && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Install cloudflared
|
# Install cloudflared
|
||||||
RUN curl https://pkg.cloudflare.com/cloudflare-main.gpg --output /usr/share/keyrings/cloudflare-main.gpg && \
|
RUN curl https://pkg.cloudflare.com/cloudflare-main.gpg --output /usr/share/keyrings/cloudflare-main.gpg && \
|
||||||
@ -56,14 +51,14 @@ RUN curl https://pkg.cloudflare.com/cloudflare-main.gpg --output /usr/share/keyr
|
|||||||
apt update && \
|
apt update && \
|
||||||
apt install --yes --no-install-recommends cloudflared && \
|
apt install --yes --no-install-recommends cloudflared && \
|
||||||
cloudflared version && \
|
cloudflared version && \
|
||||||
apt autoremove -y --purge && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
apt clean && \
|
apt --yes autoremove
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# For nscd
|
# For nscd
|
||||||
COPY ./docker/etc/nscd.conf /etc/nscd.conf
|
COPY ./docker/etc/nscd.conf /etc/nscd.conf
|
||||||
COPY ./docker/etc/sudoers /etc/sudoers
|
COPY ./docker/etc/sudoers /etc/sudoers
|
||||||
|
|
||||||
|
|
||||||
# Full Base Image
|
# Full Base Image
|
||||||
# MariaDB, Chromium and fonts
|
# MariaDB, Chromium and fonts
|
||||||
# Make sure to reuse the slim image here. Uncomment the above line if you want to build it from scratch.
|
# Make sure to reuse the slim image here. Uncomment the above line if you want to build it from scratch.
|
||||||
@ -72,7 +67,6 @@ FROM louislam/uptime-kuma:base2-slim AS base2
|
|||||||
ENV UPTIME_KUMA_ENABLE_EMBEDDED_MARIADB=1
|
ENV UPTIME_KUMA_ENABLE_EMBEDDED_MARIADB=1
|
||||||
RUN apt update && \
|
RUN apt update && \
|
||||||
apt --yes --no-install-recommends install chromium fonts-indic fonts-noto fonts-noto-cjk mariadb-server && \
|
apt --yes --no-install-recommends install chromium fonts-indic fonts-noto fonts-noto-cjk mariadb-server && \
|
||||||
apt autoremove -y --purge && \
|
|
||||||
apt clean && \
|
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
|
apt --yes autoremove && \
|
||||||
chown -R node:node /var/lib/mysql
|
chown -R node:node /var/lib/mysql
|
||||||
|
|||||||
@ -70,10 +70,7 @@ RUN apt update \
|
|||||||
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
|
&& 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 \
|
&& 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 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.
|
## Empty the directory, because we have to clone the Git repo.
|
||||||
RUN rm -rf ./* && chown node /app
|
RUN rm -rf ./* && chown node /app
|
||||||
@ -98,10 +95,7 @@ CMD ["npm", "run", "start-pr-test"]
|
|||||||
FROM louislam/uptime-kuma:base2 AS upload-artifact
|
FROM louislam/uptime-kuma:base2 AS upload-artifact
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
RUN apt update && \
|
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
|
COPY --from=build /app /app
|
||||||
|
|
||||||
@ -121,3 +115,4 @@ RUN chmod +x /app/extra/upload-github-release-asset.sh
|
|||||||
# Dist only
|
# Dist only
|
||||||
RUN cd /app && tar -zcvf $DIST dist
|
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
|
RUN /app/extra/upload-github-release-asset.sh github_api_token=$GITHUB_TOKEN owner=louislam repo=uptime-kuma tag=$VERSION filename=/app/$DIST
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user