-
-
Notifications
You must be signed in to change notification settings - Fork 743
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
Cannot backup a docker image through /proc/<pid>/root/ #5604
Comments
There seems to be a problem below borg.
|
I was curious as this is a great idea, so I checked. Definitely not borg's issue. This fails too with ENOENT: int main() { |
Same here, but It looks like glibc is doing this (yep, https://github.com/lattera/glibc/blob/master/sysdeps/posix/getcwd.c#L395 ) but But I can imagine fixing os.getcwd() to do whatever pwd does instead of relying on the glibc implementation would be outside Borg's scope. Thanks, at least the issue has been pinpointed, that might help finding a workaround.. EDIT: It's bash. |
Not exactly (https://github.com/coreutils/coreutils/blob/master/src/pwd.c):
This is because inode for .. is special here (matches .):
EDIT: pwd -L reads $PWD if exists, that's the magic |
I've done some more testing - by adding a parameter to explicitly set the working directory I get usable archives out of borg. With these changes to replace getcwd() with a --working-directory parameter if specified: 2851a84...unilynx:workingdirectory I can do:
And I have an extractable archive. A bit comparable to tar's This still leaves some corner cases open (I haven't checked whether the working-directory path is absolute and probably should, and borg still doesn't like being executed in /proc/10560/root/ unless --working-directory is set) but would a change like this be an option for borg upstream? |
Not sure this should be worked around in borg. Isn't this rather a bug in docker (or in your usage of docker)? |
OTOH, such an option could be useful to get rid of leading path segments, like replacing:
|
From
|
Maybe some other people using borg with docker can comment here whether they also see this issue or how they have it working. |
Is there an issue for this? I think I saw it some time, but I can't find it now. EDIT: found it: #1783
|
|
Closing this in favour of #1783. We have a link to the above mentioned code there also. |
I like to backup docker containers with their full filesystem as they appear to the container itself so I don't miss any changes made to the overlayfs filesystems if we incorrectly set up the volume mounts.
On linux, every docker container's filesystem can be accessed through
/proc/<pid>/root/
, and I can point rsync at this to create a full backup. This has the added advantage that I don't have to add rsync to all container images I use.I'd like to do this with borg too, but it gets confused when running inside this filesystem. But:
fails with
I can't point borg to the absolute path
/proc/$DOCKERPID/root/
either - it will just create an empty archive thenI currently just backup the volumes, but it would be nice if this were possible, or if there is a workaround that permits this.
The text was updated successfully, but these errors were encountered: