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 CHORDPRO_VERSION="6.090.0"
|
||||
|
||||
RUN apt update -y && apt-get install -y --no-install-recommends \
|
||||
ca-certificates openssl openssh-client rsync git wget build-essential cpanminus libio-socket-ssl-perl ghostscript nodejs
|
||||
RUN update-ca-certificates
|
||||
RUN cpanm chordpro@${CHORDPRO_VERSION}
|
||||
RUN wget https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz && \
|
||||
tar -xvzf zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz && \
|
||||
mv zola /usr/local/bin/zola && \
|
||||
rm zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz
|
||||
# Install runtime dependencies only, clean up after
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
openssl \
|
||||
openssh-client \
|
||||
rsync \
|
||||
git \
|
||||
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"]
|
||||
|
||||
Reference in New Issue
Block a user