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

obs-build mangles entrypoint/cmd breaking podman's systemd recognition when building from Dockerfiles #798

Closed
dcermak opened this issue Feb 23, 2022 · 1 comment

Comments

@dcermak
Copy link
Contributor

dcermak commented Feb 23, 2022

If you build a container from a Dockerfile in the Open Build Service and specify systemd as the CMD or ENTRYPOINT as follows:

CMD /usr/lib/systemd/systemd

then you obtain the following entry in the container inspect:

        "Config": {
            "Cmd": [
                "/bin/sh",
                "-c",
                "/usr/lib/systemd/systemd"
            ]
         }

Unfortunately, this breaks podman's systemd detection, which relies on the config looking like this:

        "Config": {
            "Cmd": [
                "/usr/lib/systemd/systemd"
            ]
         }

So in a nutshell, if you create a systemd-container from a Dockerfile, then you have to always add --systemd=always, otherwise the image will fail to start with the rather unhelpful message:

🕙[ 16:43:33 ] ❯ podman run --rm -it localhost/me/init:latest
Failed to mount tmpfs at /run: Operation not permitted
[!!!!!!] Failed to mount API filesystems.
Exiting PID 1...
@dcermak
Copy link
Contributor Author

dcermak commented Feb 23, 2022

Nevermind, my bad. This is an upstream issue containers/podman#13324

@dcermak dcermak closed this as completed Feb 23, 2022
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

No branches or pull requests

1 participant