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

Tar up contents of child directory onto tmpfs if mounted over #13212

Closed
wants to merge 2 commits into from

Conversation

rhatdan
Copy link
Contributor

@rhatdan rhatdan commented May 14, 2015

This patch will use the new PreMount and PostMount hooks to "tar"
up the contents of the base image on top of tmpfs mount points.

We want to add support for /run and /tmp on tmpfs and Michael Chrosby idea to
add --tmpfs PATH would require a patch like this.

Docker-DCO-1.1-Signed-off-by: Dan Walsh dwalsh@redhat.com (github: rhatdan)

@lheinlen-os
Copy link

I believe that this pull request is causing issues similar to the following when creating containers from images which do not have a /tmp directory (like an image created using scratch as the base).

[root@centos-7-docker ~]# docker run -ti hello
Timestamp: 2015-05-14 18:27:15.839329738 +0000 UTC
Code: System error

Message: [/usr/bin/tar -cf /var/lib/docker/tmp/de448245af0b33e5bb295979acdee7920a08382120c6db1d0b2de4b512d8a153664414103/_tmp.tar -C /var/lib/docker/devicemapper/mnt/de448245af0b33e5bb295979acdee7920a08382120c6db1d0b2de4b512d8a153/rootfs/tmp .] failed: /usr/bin/tar: /var/lib/docker/devicemapper/mnt/de448245af0b33e5bb295979acdee7920a08382120c6db1d0b2de4b512d8a153/rootfs/tmp: Cannot chdir: No such file or directory
/usr/bin/tar: Error is not recoverable: exiting now
: exit status 2

@rhatdan
Copy link
Contributor Author

rhatdan commented May 14, 2015

@lheinlen-os Is that on a Fedora or RHEL system?

This patch would not cause that but using the patch for mounting a tmpfs on /tmp might.

@rhatdan
Copy link
Contributor Author

rhatdan commented May 14, 2015

@lheinlen-os I added a check to make sure fullDest exists before running the tar commands which should prevent the failure you are seeing

@lheinlen-os
Copy link

@rhatdan Excellent! Thank you!

@rhatdan
Copy link
Contributor Author

rhatdan commented May 20, 2015

I am reworking these patches to only happen when you run in systemd mode. BTW.

@rhatdan
Copy link
Contributor Author

rhatdan commented May 28, 2015

#13525
uses this patch.

This patch will use the new PreMount and PostMount hooks to "tar"
up the contents of the base image on top of tmpfs mount points.

We want to add support for /run and /tmp on tmpfs and Michael Chrosby idea to
add --tmpfs PATH would require a patch like this.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
This patch will allow users to setup tmpfs mounts on top of
any directory.  One of the big benefits of this would be
to allow --read-only to work when an application needs to write to /run or /tmp.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
@rhatdan
Copy link
Contributor Author

rhatdan commented May 29, 2015

I have incorporated this pull request into #13587

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

Successfully merging this pull request may close these issues.

None yet

4 participants