Reduce final image size
These optimizations reduce the final image size by over 60%.
This commit is contained in:
35
Dockerfile
35
Dockerfile
@@ -1,18 +1,31 @@
|
|||||||
FROM debian:latest
|
FROM debian:bullseye-slim
|
||||||
|
|
||||||
# Used in the makefile
|
ENV CHORDPRO_PIPELINE=true
|
||||||
ENV CHORDPRO_PIPELINE true
|
|
||||||
|
|
||||||
ARG ZOLA_VERSION="0.21.0"
|
ARG ZOLA_VERSION="0.21.0"
|
||||||
ARG CHORDPRO_VERSION="6.090.0"
|
ARG CHORDPRO_VERSION="6.090.0"
|
||||||
|
|
||||||
RUN apt update -y && apt-get install -y --no-install-recommends \
|
# Install runtime dependencies only, clean up after
|
||||||
ca-certificates openssl openssh-client rsync git wget build-essential cpanminus libio-socket-ssl-perl ghostscript nodejs
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
RUN update-ca-certificates
|
ca-certificates \
|
||||||
RUN cpanm chordpro@${CHORDPRO_VERSION}
|
openssl \
|
||||||
RUN wget https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz && \
|
openssh-client \
|
||||||
tar -xvzf zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz && \
|
rsync \
|
||||||
mv zola /usr/local/bin/zola && \
|
git \
|
||||||
rm zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz
|
wget \
|
||||||
|
libio-socket-ssl-perl \
|
||||||
|
ghostscript \
|
||||||
|
nodejs \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends build-essential cpanminus \
|
||||||
|
&& cpanm chordpro@${CHORDPRO_VERSION} \
|
||||||
|
&& apt-get purge -y --auto-remove build-essential cpanminus \
|
||||||
|
&& rm -rf /root/.cpanm /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN wget -q https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz \
|
||||||
|
&& tar -xzf zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz \
|
||||||
|
&& mv zola /usr/local/bin/ \
|
||||||
|
&& rm zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz
|
||||||
|
|
||||||
CMD ["/bin/sh"]
|
CMD ["/bin/sh"]
|
||||||
|
|||||||
Reference in New Issue
Block a user