Sharp: How to reduce Docker image after installing sharp?

Created on 28 Sep 2019  ·  2Comments  ·  Source: lovell/sharp

Hello.

OS: Alpine 3.10
Dockerfile

...
RUN set -o pipefail \
    && apk update \
    && apk add vips-dev fftw-dev build-base --update-cache \
        --repository http://dl-3.alpinelinux.org/alpine/edge/community/ \
        --repository http://dl-3.alpinelinux.org/alpine/edge/main
...

After install 299 MB:
4150afe90f70 3 minutes ago /bin/sh -c set -o pipefail && apk update… 299MB

These packages are only needed for building, can uh be removed?
How can I reduce the size of the image?

installation

Most helpful comment

You can just install sharp without installing dev libraries - sharp provides pre-built vips.

스크린샷 2019-09-29 오후 12 21 47

All 2 comments

You can just install sharp without installing dev libraries - sharp provides pre-built vips.

스크린샷 2019-09-29 오후 12 21 47

Use multi stage builds.

Was this page helpful?
0 / 5 - 0 ratings