-
Notifications
You must be signed in to change notification settings - Fork 785
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
[OSTree] Cannot build rootfs with Containerfile due to dangling files /etc/{hostname,hosts,resolv.conf} #5093
Comments
This gets you closer, but not sure it is enough, or if the --network=none will cause you issues.
|
you could do your commit in the same RUN command. RUN mv /etc/ /usr/; ostree commit ... |
Thanks for the suggestion!
Just switched to native overlayfs from
|
The files are all bind mounted from the host into the container so they are mount point and cannot be moved. You would fist need to unmount them. This is required for us to setup proper networking within the container.
I don't see any solution here as this is really the normal behaviour, the only way would be to add a new option to also disable the creation of the hostname file. |
Thanks for your insights Network is only required in the beginning and I just double checked that RUN --network=none rm -rf /etc || true
This sounds like the best alternative to not break any functionality in Podman 🙂 |
@Luap99 does it make sense to modify /etc/hostname with network=none is done? |
podman run --network=none alpine mount | grep /etc The following seems to work for me.
|
This should illustrate the problem better (and everything here is executed from the
Seems like |
I wasn't aware the you could mv a mount point location. But just guessing I assume this happens because it just uses rename(2), however if you try to actually copy the data to another partition (rename only works if you are on the same partition) it will fail as it cannot unlink the mount point. So my best guess would be fuse-overlays correctly uses rename() while the native one does not for whatever reason, not sure if this is a bug or expected. cc @giuseppe. |
Hostname is not really related to networking, the hostname is controlled by the UTS namespace. But even then there is no such thing as no hostname, the runtime will always set a hostname so we should always have a valid hostname file. I am not sure if applications actually care about |
Fair point! |
Yes I have no problem with adding an opt in flag to make it work consistently. I have no idea how the flag parsing for single RUN instructions works but adding it as top level option to podman build should be easy enough. |
A friendly reminder that this issue had no activity for 30 days. |
Bump (don't close this @github-actions) |
@GrabbenD interested in opening a PR to add that flag? |
I'd love to but I'm not a programmer and wouldn't know how 😞 |
Fixes: containers#5093 Signed-off-by: Daniel J Walsh <[email protected]>
Fixes: containers#5093 Signed-off-by: Daniel J Walsh <[email protected]>
Fixes: containers#5093 Signed-off-by: Daniel J Walsh <[email protected]>
Fixes: containers#5093 Signed-off-by: Daniel J Walsh <[email protected]>
Fixes: containers#5093 Signed-off-by: Daniel J Walsh <[email protected]>
Fixes: containers#5093 Signed-off-by: Daniel J Walsh <[email protected]>
Fixes: containers#5093 Signed-off-by: Daniel J Walsh <[email protected]>
Fixes: containers#5093 Signed-off-by: Daniel J Walsh <[email protected]>
Fixes: containers#5093 Signed-off-by: Daniel J Walsh <[email protected]>
Fixes: containers#5093 Signed-off-by: Daniel J Walsh <[email protected]>
Issue Description
One of requirements for building a OSTree images is moving
/etc
to/usr/etc
(see: https://ostree.readthedocs.io/en/stable/manual/adapting-existing/). However, this isn't possible in a single stage build with Containerfile as seen here:These dangling files prevent
$ ostree commit
from deploying:Deploying tree: Initializing deployment: Preparing /etc: Tree contains both /etc and /usr/etc
Furthermore they can't be removed:
Disabling network isn't possible to workaround this:
RUN --network=none mv /etc /usr/
Currently the only working workaround is to export rootfs/ and then modify it outside of Containerfile but ideally this shouldn't be needed to keep everything inside one place (Containerfile)
Steps to reproduce the issue
Steps to reproduce the issue
$ podman build -f Containerfile
Describe the results you received
Dangling files exist in
/etc/{hostname,hosts,resolv.conf}
after moving/etc
to/usr/etc
Describe the results you expected
It should be possible to move contents of
/etc
to/usr/etc
to comply with OSTree image requirementspodman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
N/A
Additional information
N/A
The text was updated successfully, but these errors were encountered: