From: Ville Skyttä Date: Sun, 1 Dec 2019 05:58:04 +0000 (+0200) Subject: docker: Check for /.dockerenv too X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;ds=inline;h=a24df0c780aaf74f0ed408bc55386b9f933fb7aa;p=virt-what.git docker: Check for /.dockerenv too /.dockerinit may no longer exist. Ref https://github.com/moby/moby/issues/18355 (cherry picked from commit e2c49cda221f95cb65b1b3ac3ae15aa41d92f519) --- 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 59743c3..900a05d 100644 --- a/virt-what.in +++ b/virt-what.in @@ -349,7 +349,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