`COPY --chmod` reduced the size of my container image by 35%

This page summarizes the projects mentioned and recommended in the original post on /r/programming

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • ko

    Build and deploy Go applications

  • If you're using Go, I recommend https://github.com/google/ko (shameless plug), or for Java, use Jib.

  • go-containerregistry

    Go library and CLIs for working with container registries

  • There's also (another shameless plug) crane append which simply adds the contents of a tar to an existing base image directly in the registry: https://github.com/google/go-containerregistry/blob/main/cmd/crane/doc/crane_append.md

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Moby

    The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems

  • COPY --exclude. https://github.com/moby/moby/issues/15771

  • docker-f1ux

    Images for building older Forum One themes

  • With Nix you have to look up obscure sites like this and look for specific hashes and pray that the version you need exists (or package it and distribute it yourself). Approaches like this are not that inviting.

  • Lean and Mean Docker containers

    Slim(toolkit): Don't change anything in your container image and minify it by up to 30x (and for compiled languages even more) making it secure too! (free and open source)

  • Or you can save your time micromanaging your Dockerfile and just use docker-slim.

  • buildkit

    concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit

  • Similarly, Dockerfile with buildkit support a 'COPY --chmod' directive now. https://github.com/moby/buildkit/pull/1492. Again not quite everything you're looking for, but addresses the OP's issue.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts