From: Ville Skyttä Date: Sun, 1 Dec 2019 05:58:04 +0000 (+0200) Subject: docker: Check for /.dockerenv too X-Git-Tag: v1.21~4 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=e2c49cda221f95cb65b1b3ac3ae15aa41d92f519;p=virt-what.git docker: Check for /.dockerenv too /.dockerinit may no longer exist. Ref https://github.com/moby/moby/issues/18355 --- diff --git a/tests/docker/.dockerenv b/tests/docker/.dockerenv new file mode 100644 index 0000000..e69de29 diff --git a/tests/docker/Makefile.am b/tests/docker/Makefile.am index e0ea991..e2a95d8 100644 --- a/tests/docker/Makefile.am +++ b/tests/docker/Makefile.am @@ -21,6 +21,7 @@ TESTS = test.sh EXTRA_DIST = \ test.sh \ + .dockerenv \ .dockerinit \ proc/cpuinfo \ proc/self/status \ diff --git a/virt-what.in b/virt-what.in index a61ce91..db16b5f 100644 --- a/virt-what.in +++ b/virt-what.in @@ -345,7 +345,7 @@ if ! "$skip_lkvm"; then fi # Check for Docker. -if [ -f "${root}/.dockerinit" ]; then +if [ -f "${root}/.dockerenv" ] || [ -f "${root}/.dockerinit" ]; then echo docker fi