docker: Check for /.dockerenv too
authorVille Skyttä <ville.skytta@iki.fi>
Sun, 1 Dec 2019 05:58:04 +0000 (07:58 +0200)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 16 Jan 2020 08:38:02 +0000 (08:38 +0000)
/.dockerinit may no longer exist.

Ref https://github.com/moby/moby/issues/18355

tests/docker/.dockerenv [new file with mode: 0644]
tests/docker/Makefile.am
virt-what.in

diff --git a/tests/docker/.dockerenv b/tests/docker/.dockerenv
new file mode 100644 (file)
index 0000000..e69de29
index e0ea991..e2a95d8 100644 (file)
@@ -21,6 +21,7 @@ TESTS = test.sh
 
 EXTRA_DIST = \
        test.sh \
+       .dockerenv \
        .dockerinit \
        proc/cpuinfo \
        proc/self/status \
index a61ce91..db16b5f 100644 (file)
@@ -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