-
Notifications
You must be signed in to change notification settings - Fork 426
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
Unable to bind directory during build to location that does not already exist #6181
Comments
This is intentional. The mount point is expected to be created in the .def file. |
Oh, okay. How do I do this? Creating the directory in It seems the documentation is wrong in this case:
It is also not mentioned in |
This is really not my area of knowledge, I'm sorry about that. In fact I tried a couple of things to create the directory and it didn't seem to help, so I may in fact be wrong in what I already said. Hopefully somebody else will respond, or maybe you'll have better luck asking on the google group or in slack. |
I can trace this working on 3.7.4, so this is probably a regression introduced after that: These are my test files:
Testing that with Singularity 3.7.4:
Testing with 3.8.0:
|
You can work around this by unsetting SINGULARITY_BINDPATH (or setting it to an empty string), or by creating the mountpoint before
But neither of these are ideal. The build process should not make assumptions about the runtime environment. And forcing end-users to unset the bind paths defined by the admin in the global config defeats the purpose of the global config. |
The --bind option was added in pr #5911. |
@eburgueno I see now that in your 3.7.4 test all you did was show that there was no error message, but you did not show that it was actually bind-mounting anything. @cclerget said that SINGULARITY_BINDPATH was ignored prior to 3.8.0. Can you confirm that? |
@DrDaveD yes, it appears to be ignored:
|
Would be nice to have a clean, simple, and complete example for this. |
I had the same issue, but this snippet from the docs solved it for me. https://apptainer.org/docs/user/main/build_a_container.html#bind
In my case, I did |
Version of Singularity:
Expected behavior
I am using
--bind=/opt/foo
to bind a directory during build. The expected behaviour is that/opt/foo
is accessible during build (i.e. that bind works the same way as when running an image).Actual behavior
It fails with
Steps to reproduce this behavior
Assume this minimal definition file:
Create a directory
/opt/foo
and runNote that if I bind to a location that already exists in the base image (e.g.
--bind=/opt/foo:/mnt
) it works.What OS/distro are you running
How did you install Singularity
Installed using a deb package that I created from source, using this custom tool.
The text was updated successfully, but these errors were encountered: