Skip to content

Docker images are larger than they need to be #22

@jloveridge

Description

@jloveridge

I noticed the Dockerfile for the alpine images have the following in them:

# Get Dependencies
COPY ./nsolid-bundle-${NSOLID_VERSION}/nsolid-*${NODEJS_LTS}-alpine-x64.tar.gz .
# later it does the following in a RUN command
# Cleanup
&& rm nsolid*.tar.gz \
&& apk del .build-deps

Unfortunately since the tar.gz file is added in a separate layer removing the file as part of the RUN step doesn't reduce the image size. I would recommend either using ADD which can extract the contents of the archive. Or that you wget the file as part of the RUN command.

From the Dockerfile reference on ADD:

If is a local tar archive in a recognized compression format (identity, gzip,
bzip2 or xz) then it is unpacked as a directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions