Selaa lähdekoodia

Handle docker start inside overlayfs

Raspberry Pi allows to start system under overlayfs.
Docker is successfully fallbacks to fuse-overlay but not starting
because of the `Error starting daemon: rename /var/lib/docker/runtimes /var/lib/docker/runtimes-old: invalid cross-device link` error
It's happening because `rename` is not supported by overlayfs.

After manually removing directory `runtimes` docker starts and works successfully

Signed-off-by: Illia Antypenko <ilya@antipenko.pp.ua>
(cherry picked from commit d591710f82a20e6f84038d5dbc67282fd50ea6bc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Illia Antypenko 3 vuotta sitten
vanhempi
commit
a8926de2a1
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3 1
      daemon/runtime_unix.go

+ 3 - 1
daemon/runtime_unix.go

@@ -69,7 +69,9 @@ func (daemon *Daemon) initRuntimes(runtimes map[string]types.Runtime) (err error
 		}
 
 		if err = os.Rename(runtimeDir, runtimeDir+"-old"); err != nil {
-			return
+			if err = os.RemoveAll(runtimeDir); err != nil {
+				return
+			}
 		}
 		if err = os.Rename(tmpDir, runtimeDir); err != nil {
 			err = errors.Wrap(err, "failed to setup runtimes dir, new containers may not start")