[23.0 backport] Work around missing rename support when the backing filesystem is overlayfs #44834
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Intro
Raspberry Pi allows to start system under overlayfs.
Docker is successfully fallbacks to
fuse-overlay
but not startingbecause 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 isuserspace
- What I did
Remove
runtimes
directory in case renaming failed.- How I did it
On
os.rename
error try to removeruntimes
directory .- How to verify it
Run a docker under the overlayfs as backing FS.
RUN mkdir -p "/docker/runtimes"
right afterFROM dev-systemd-${SYSTEMD} AS dev
inDockerfile
make BIND_DIR=. shell
wget -O /usr/local/bin/fuse-overlayfs https://github.com/containers/fuse-overlayfs/releases/download/v1.8.2/fuse-overlayfs-x86_64
chmod +x /usr/local/bin/fuse-overlayfs
hack/make.sh binary install-binary
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 fixdockerd
starts fine.- Description for the changelog
Remove
runtimes
directory on startup in case renaming toruntimes-old
failed- A picture of a cute animal (not mandatory but encouraged)
closes docker/for-linux#230