Refactor Dockerfile to optimize SUPERCRONIC installation

This commit is contained in:
Roger Gonzalez 2024-12-15 13:43:24 -03:00
parent 48b2493797
commit 5d93b4695c
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6

View File

@ -1,16 +1,13 @@
FROM python:alpine FROM python:alpine
RUN apk add --no-cache curl RUN apk add --no-cache curl \
&& SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.2.33/supercronic-linux-amd64 \
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.2.33/supercronic-linux-amd64 \ && SUPERCRONIC_SHA1SUM=71b0d58cc53f6bd72cf2f293e09e294b79c666d8 \
SUPERCRONIC_SHA1SUM=71b0d58cc53f6bd72cf2f293e09e294b79c666d8 \ && curl -fsSLO "$SUPERCRONIC_URL" \
SUPERCRONIC=supercronic-linux-amd64 && echo "${SUPERCRONIC_SHA1SUM} supercronic-linux-amd64" | sha1sum -c - \
&& chmod +x supercronic-linux-amd64 \
RUN curl -fsSLO "$SUPERCRONIC_URL" \ && mv supercronic-linux-amd64 /usr/local/bin/supercronic \
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \ && apk del curl
&& chmod +x "$SUPERCRONIC" \
&& mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \
&& ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic
RUN pip install --no-cache-dir subscleaner RUN pip install --no-cache-dir subscleaner