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

libcontainer: rootfs_linux: support overlayfs #1314

Merged
merged 1 commit into from
Feb 8, 2017

Conversation

runcom
Copy link
Member

@runcom runcom commented Feb 6, 2017

As the runtime-spec allows it, we want to be able to specify overlayfs
mounts with:

{
    "destination": "/etc/pki",
    "type": "overlay",
    "source": "overlay",
    "options": [
        "lowerdir=/etc/pki:/home/amurdaca/go/src/github.com/opencontainers/runc/rootfs_fedora/etc/pki"
    ]
},

This patch takes care of allowing overlayfs mounts. Both RO and RW
should be supported.

Signed-off-by: Antonio Murdaca runcom@redhat.com

As the runtime-spec allows it, we want to be able to specify overlayfs
mounts with:

    {
        "destination": "/etc/pki",
        "type": "overlay",
        "source": "overlay",
        "options": [
            "lowerdir=/etc/pki:/home/amurdaca/go/src/github.com/opencontainers/runc/rootfs_fedora/etc/pki"
        ]
    },

This patch takes care of allowing overlayfs mounts. Both RO and RW
should be supported.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
@runcom
Copy link
Member Author

runcom commented Feb 6, 2017

@mrunalp @crosbymichael PTAL

@crosbymichael
Copy link
Member

@runcom actually a fun thing that I have been doing is that you can also mount with the destination as / to have it mount the rootfs for the contianer. Its pretty cool.

@runcom
Copy link
Member Author

runcom commented Feb 6, 2017

yeah, maybe use runtime config directly in docker to mount the rootfs (just wondering...)

@mrunalp
Copy link
Contributor

mrunalp commented Feb 7, 2017

LGTM

Approved with PullApprove

// this can happen when a user specifies mounts within other mounts to cause breakouts or other
// evil stuff to try to escape the container's rootfs.
var err error
if dest, err = symlink.FollowSymlinkInScope(filepath.Join(rootfs, m.Destination), rootfs); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/filepath.Join(rootfs, m.Destination)/dest?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is copy/pasted from the bind switch case..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, we can fix that later then.

@hqhq
Copy link
Contributor

hqhq commented Feb 8, 2017

LGTM

Approved with PullApprove

@hqhq hqhq merged commit a8d7eb7 into opencontainers:master Feb 8, 2017
@runcom runcom deleted the overlay-mounts branch February 8, 2017 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants