docker-archive / docker-registry

This is **DEPRECATED**! Please go to https://github.com/docker/distribution
Apache License 2.0
2.88k stars 877 forks source link

Feature For Developers: Registry could flat images #990

Closed LiberQuack closed 7 years ago

LiberQuack commented 9 years ago

Docker is great for deploying applications and helps the community a lot and lots of people use it in your development workflow, so do I

The Problem

One of the pitfalls I found is the size of images, I mean, I started to develop a simple app with three friends, the app uses postgres and mongo. Nothing wrong until I realize I was downloading more than 3GB for a simple app, also my friends too...

4 people * ~3GB = Lot of data

The final containers from postgres and mongo have some hundreds of MB, what we need are some hundreds, so we shouldn`t need to download some thousands of MB.

Possible Solution

If it were possible to tell registry I want a flatten image, registry could prepare and send it to me. Maybe I`m messing with some of the cool layering feature, because if the base of two differente images are the same, we would have to download it 2 times.

Dockerfiles can have only one FROM so if we request a flat image, registry could send a layered base image + one layer which represents a final postgres container. There could be a command docker pull postgres --flatten

dmp42 commented 9 years ago

Image squashing is definitely an interesting idea, though a complicated one.

I guess you can do some squashing on the client already, using docker export then docker import. Your image is now a one layer image. Sure, you loose the benefits of shared layers, but then.