Skip to content
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

[23.0 backport] Work around missing rename support when the backing filesystem is overlayfs #44834

Merged
merged 2 commits into from Jan 18, 2023

Conversation

thaJeztah
Copy link
Member


Intro

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.

relates to #25409 (comment)
docker in this case is userspace

- What I did
Remove runtimes directory in case renaming failed.

- How I did it
On os.rename error try to remove runtimes directory .

- How to verify it
Run a docker under the overlayfs as backing FS.

  1. Add RUN mkdir -p "/docker/runtimes" right after FROM dev-systemd-${SYSTEMD} AS dev in Dockerfile
  2. Run make BIND_DIR=. shell
  3. Execute wget -O /usr/local/bin/fuse-overlayfs https://github.com/containers/fuse-overlayfs/releases/download/v1.8.2/fuse-overlayfs-x86_64
  4. Execute chmod +x /usr/local/bin/fuse-overlayfs
  5. Execute hack/make.sh binary install-binary
  6. Execute dockerd --data-root /docker

Without the fix docker is failing with failed to start daemon: rename /docker/runtimes /docker/runtimes-old: invalid cross-device link with the fix dockerd starts fine.

- Description for the changelog
Remove runtimes directory on startup in case renaming to runtimes-old failed

- A picture of a cute animal (not mandatory but encouraged)

closes docker/for-linux#230

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 d591710)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
…emoving it

Signed-off-by: Illia Antypenko <ilya@antipenko.pp.ua>
(cherry picked from commit 07ba3e3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

Thx! Let me bring this one in

@thaJeztah thaJeztah merged commit 4df8f77 into moby:23.0 Jan 18, 2023
@thaJeztah thaJeztah deleted the 23.0_backport_docker_in_overlayfs branch January 18, 2023 09:42
@neersighted neersighted added impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. labels Jan 23, 2023
@AlexanderZvyagin
Copy link

The fix is incomplete. I use standard ubuntu-22.10, but my / and /home are different mounts (both are ext4). I saw this error:
installation could not be completed due to: rename /tmp/340006179-ext-install/drone_drone-ci-docker-extension /home/zvyagin/.docker/desktop/extensions/drone_drone-ci-docker-extension: invalid cross-device link
Manage install drone-extension with the following workaround:

  • create extensions folder in the root fs /
  • set symbolik link to /home/....
  • install extension

@neersighted
Copy link
Member

Your issue is unrelated to what is being addressed here, and Docker Desktop does not yet include this code. Renaming from /tmp to anywhere else is definitely not something that should be attempted as /tmp can often be a different filesystem, but this deserves a new issue (and may be part of Desktop as that is where all the extension code lives) anyway.

@thaJeztah
Copy link
Member Author

@WarShoe I think your issue is what's reported in this ticket;

A fix for that should be included in the upcoming Docker Desktop 4.18

(but perhaps @felipecruz91 or @benja-M-1 can confirm)

@felipecruz91
Copy link

@thaJeztah Yes, that's correct - we'll be releasing a fix in Docker Desktop 4.18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/storage/overlay impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants