New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrading docker 17.xx -> 1.12 should not be a delayed timebomb, but an immediate explosion #2196

Closed
euank opened this Issue Oct 14, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@euank
Contributor

euank commented Oct 14, 2017

Background

We're implementing a mechanism to allow selecting an older version of Docker (more news on that soon(tm)).
Since Docker doesn't support downgrading of the daemon's data, we also recommend deleting /var/lib/docker as part of the downgrade process.

This is all well and good, but there's a caveat...

Problem

The following sequence of events leads to a timebomb:

  1. Launch with 17.xx and run a container; this creates /var/lib/docker/overlay2
  2. Downgrade without(!) deleting /var/lib/docker
  3. Run a container; 1.12 creates /var/lib/docker/overlay and runs with it
  4. Restart docker; 1.12 now will complain that both overlay and overlay2 are present and fail 💥

This is especially bad since significant time could pass between 2. and 3., leading this to be a timebomb.

Solution

Since the only way to get into this situation is by doing something inherently broken (downgrading docker without removing its data), the failure is expected.
It shouldn't be delayed though.

The best solution is simply to ensure that the initial launch, step 3., fails noisily as soon as it recognizes that it would create a second graphdriver.

Alternate solutions

Letting 1.12 use overlay2 if it's already present is an alternate solution to this specific instance of the downgrade problem.
However, the general problem of downgrading not being supported is still true, and this papers over it.
If a user wishes to risk her luck with re-using the overlay2 directory, she may easily enough configure the storage driver to overlay2 via the daemon flag for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment