RFR: 8230848: OSContainer: Refactor container detection code

Severin Gehwolf sgehwolf at redhat.com
Tue Oct 1 19:00:32 UTC 2019


On Tue, 2019-10-01 at 14:36 -0400, Bob Vandette wrote:
> BTW:  Can you tell me if there’s a .dockerenv file in the
> fedora/podman’s container / directory or is it a .podmanenv file?
> I’m wondering if I can use the existence of these files as the
> triigger that we’re containerized.  This is for another bug.

According to [1] it's '/run/.containerenv' for podman.

$ sudo docker run --rm -ti fedora:30 /bin/bash -c "ls /.dockerenv"
/.dockerenv
$ podman run -ti --rm fedora:31 /bin/bash -c "ls /run/.containerenv"
/run/.containerenv
$ sudo docker run --rm -ti fedora:30 /bin/bash -c "cat /.dockerenv"
$ podman run -ti --rm fedora:31 /bin/bash -c "cat /run/.containerenv"
$ 

Thanks,
Severin

[1] https://github.com/containers/libpod/issues/648



More information about the hotspot-dev mailing list