Code Monkey home page Code Monkey logo

Comments (7)

InformatiQ avatar InformatiQ commented on May 18, 2024 1

I actually found the issue
i needed to add 'bind' in the 'options'
{
"type": "bind",
"source": "/home/user",
"destination": "/home/user",
"options": "bind"
}
not sure if this is a bug, but i would have expected type: bind to imply a bind mount

from runc.

GeertJohan avatar GeertJohan commented on May 18, 2024

Please don't just paste some logs into an issue. Especially not when they contain markdown directives. Put the logs between tripple backticks: ``` to let the logs render in a nice way.

from runc.

rajasec avatar rajasec commented on May 18, 2024

Currently it has the bind option supported as per the code.

Can you check whether your new directory is created inside your rootfs ?

if err := createIfNotExists(dest, stat.IsDir()); err != nil {
return err
}
if err := syscall.Mount(m.Source, dest, m.Device, uintptr(m.Flags), data); err != nil {
return err
}
if m.Flags&syscall.MS_RDONLY != 0 {
if err := syscall.Mount(m.Source, dest, m.Device, uintptr(m.Flags|syscall.MS_REMOUNT), ""); err != nil {
return err
}
}
if m.Relabel != "" {
if err := label.Relabel(m.Source, mountLabel, m.Relabel); err != nil {
return err
}
}
if m.Flags&syscall.MS_PRIVATE != 0 {
if err := syscall.Mount("", dest, "none", uintptr(syscall.MS_PRIVATE), ""); err != nil {
return err
}
}

from runc.

rajasec avatar rajasec commented on May 18, 2024

It is failing in the following call during the mount
if err := syscall.Mount(m.Source, dest, m.Device, uintptr(m.Flags), data); err != nil

from runc.

rajasec avatar rajasec commented on May 18, 2024

I could solve the problem via the code by adding MS_BIND
if err := syscall.Mount(m.Source, dest, m.Device,uintptr(syscall.MS_BIND),data); err != nil {
Instead of changing or modifying m.Flags, add the MS_BIND option in go code..

or modify container.json to include option bind..

from runc.

cyphar avatar cyphar commented on May 18, 2024

@InformatiQ On *nix systems, you need to specify mount -o bind /src /mnt. The -o maps to the option field in the OCF format. There is no such filesystem type as bind. In fact, the type field is ignored in this case and if you make it empty it still would work. So really, it would be surprising if specifying the type of mount as bind would work -- since that's now how mounting works.

@rajasec Please don't post large swathes of code in comments. Please either reference the code lines or just make a PR for review.

from runc.

InformatiQ avatar InformatiQ commented on May 18, 2024

that works fine for me

from runc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.