2

How are these two commands different? Both of them launch a shell as pid 1 and make the same mounts and volumes,

buildah run --tty --mount type=tmpfs,destination=/run -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
  $(buildah from centos:7) /bin/sh -c 'exec /sbin/init'

podman run -ti    --mount type=tmpfs,destination=/run -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
  centos:7                 /bin/sh -c 'exec /sbin/init'

Only the podman one works though. What am I misunderstanding here?

Evan Carroll
  • 28,578
  • 45
  • 164
  • 290

1 Answers1

2

Podman run configures the proper environment for the init(systemd) system to run. Buildah does not. The goal is NOT to have Podman run and Buildah run be the same.

buildah run is the equivalent of the RUN command in a Continerfile(Dockerfile). Since I have never seen anyone create a Containerfile like

FROM centos:7
RUN /bin/init

It is not something we considered, and are unlikely to support.

rhatdan
  • 271
  • 1
  • 3
  • "Podman run configures _the proper environment_ for the init(systemd) system to run." Please god, just tell me what this means and where I can read more. How does podman configure a different environment? The answer to "why is this different" and "how is it different" isn't that, "it's different". I just want to learn more. Consider, in building an image I need systemd/systemctl. This isn't hypothetical. So if I need podman too, that's great! That's what i'm doing, and that's how you designed it. But I'm not sure _why_ I need podman to build an imagine that uses systemd. – Evan Carroll Nov 18 '20 at 20:44