docker-nsolid
docker-nsolid copied to clipboard
Docker images are larger than they need to be
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.