git rebase is a very useful construct in source control management, as it allows you to re-apply your changes atop a different branch of the same repository. While this concept transitions perfectly to container management (updating a container could be as easy as a
docker rebase), and the Docker client is inspired by the
git semantics, Docker has no such feature (in fact, Solomon Hykes used
merge as examples of things "that we don't want"). Currently,
zypper-docker works by applying an updated layer on top of an existing image. While this does work quite well, it separates the process of updating the base image and updating all of your derivative images (you need to re-download new packages for each derivative image).
So, this project will be working on implementing something like
git rebase for Docker images. There are several issues with this, mainly involving the fact that we are rebasing binaries and not source code, so merge conflicts will probably be quite messy. But it should be possible to implement some form of simple rebase method (which will essentially fall back to
docker build in the worst case, which is what you were going to run anyway). By maximising the reuse of the existing image layers, it should be possible to reduce build times quite significantly.
Unfortunately, it seems like there's no nice way of implementing
docker rebase without having access to the internal image format of Docker (as
docker diff only gives you information on containers and not on images). Further work could be done to see what would be required to do as-close-as-possible live-
rebase of a docker container.
- Load Docker image graphs [DONE].
- Resolve common-parent and non-common-parent cases [DESIGNED].
- Recognise updated layers (using the
- Deal with
- Figure out how to nicely do single layer builds [STUCK].
- Code: https://github.com/cyphar/docker-rebase (Apache 2.0 Free Software)
- Post: https://www.cyphar.com/blog/hackweek-13-docker-rebase (CC BY-ND 4.0)
Looking for mad skills in:
This project is part of:
Hack Week 13
Throughout this project, I will learn about Kub...