shatteredsilicon / ssm-submodules

GNU Affero General Public License v3.0
1 stars 2 forks source link

ssm-server docker image seems to ship with many layers - they should be squashed #188

Closed gordan-bobic closed 9 months ago

gordan-bobic commented 11 months ago

It looks like the docker image we are pushing has many layers instead of just one. This should be squashed at build time. In fact, it looks like docker build flags include --squash, but it still seems to result in a multi-layered image. Ideally we want the final image to be a single flat image.

If we are dealing with a bug or limitation in docker, this should be achieved by whatever means available, even it means extracting a tarball and instantiating a flat image from that.

oblitorum commented 9 months ago

Hmm, seems the --squash argument is deprecated from recent versions, it's not listed in help message of docker build either. We could use multi-stage build to squash instead. Making the patch now.

oblitorum commented 9 months ago

Also, using docker-slim to shrink the image as in this PR also produces a single-layer image.