docker / roadmap

Welcome to the Public Roadmap for All Things Docker! We welcome your ideas.
https://github.com/orgs/docker/projects/51
Creative Commons Zero v1.0 Universal
1.74k stars 261 forks source link

Move --squash from experimental to released #208

Open robertlagrant opened 3 years ago

robertlagrant commented 3 years ago

Tell us about your request docker build --squash has been around since 2017. Completing this feature would allow much more readable Dockerfiles, and would remove a learning step for Docker beginners.

Which service(s) is this request for? Docker engine and CLI.

Are you currently working around the issue? Through lots of ampersands. Chaining commands so they do not add individual layers makes things hard to read, but achieves the same effect.

tobiasstadler commented 2 years ago

Are there any plans to remove the experimental status from --squash?

chris-crone commented 2 years ago

Hi @robertlagrant and @tobiasstadler, thanks for posting this proposal!

I have two quick questions that would help me better understand your use cases:

  1. Why are you currently using --squash? (Phrased another way, what goal are you achieving using this flag)
  2. Have you tried multistage builds and/or heredoc support?
tobiasstadler commented 2 years ago

Hi @robertlagrant

I am copying some (large) files to populate a PostgreSQL DB. As these file aren't used after populating the DB I want to get rid of them.

As you sad, I could created the DB in a "builder" container and only copy the PostgreSQL data files to to actually container, but using --squash feels little bit nicer/easier.

I am not sure if I could use heredoc.