Blame SOURCES/0023-docker-Check-for-.dockerenv-too.patch

c0ee7c
From a24df0c780aaf74f0ed408bc55386b9f933fb7aa Mon Sep 17 00:00:00 2001
c0ee7c
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
c0ee7c
Date: Sun, 1 Dec 2019 07:58:04 +0200
c0ee7c
Subject: [PATCH 23/25] docker: Check for /.dockerenv too
c0ee7c
c0ee7c
/.dockerinit may no longer exist.
c0ee7c
c0ee7c
Ref https://github.com/moby/moby/issues/18355
c0ee7c
c0ee7c
(cherry picked from commit e2c49cda221f95cb65b1b3ac3ae15aa41d92f519)
c0ee7c
---
c0ee7c
 tests/docker/.dockerenv  | 0
c0ee7c
 tests/docker/Makefile.am | 1 +
c0ee7c
 virt-what.in             | 2 +-
c0ee7c
 3 files changed, 2 insertions(+), 1 deletion(-)
c0ee7c
 create mode 100644 tests/docker/.dockerenv
c0ee7c
c0ee7c
diff --git a/tests/docker/.dockerenv b/tests/docker/.dockerenv
c0ee7c
new file mode 100644
c0ee7c
index 0000000..e69de29
c0ee7c
diff --git a/tests/docker/Makefile.am b/tests/docker/Makefile.am
c0ee7c
index e0ea991..e2a95d8 100644
c0ee7c
--- a/tests/docker/Makefile.am
c0ee7c
+++ b/tests/docker/Makefile.am
c0ee7c
@@ -21,6 +21,7 @@ TESTS = test.sh
c0ee7c
 
c0ee7c
 EXTRA_DIST = \
c0ee7c
 	test.sh \
c0ee7c
+	.dockerenv \
c0ee7c
 	.dockerinit \
c0ee7c
 	proc/cpuinfo \
c0ee7c
 	proc/self/status \
c0ee7c
diff --git a/virt-what.in b/virt-what.in
c0ee7c
index 59743c3..900a05d 100644
c0ee7c
--- a/virt-what.in
c0ee7c
+++ b/virt-what.in
c0ee7c
@@ -349,7 +349,7 @@ if ! "$skip_lkvm"; then
c0ee7c
 fi
c0ee7c
 
c0ee7c
 # Check for Docker.
c0ee7c
-if [ -f "${root}/.dockerinit" ]; then
c0ee7c
+if [ -f "${root}/.dockerenv" ] || [ -f "${root}/.dockerinit" ]; then
c0ee7c
     echo docker
c0ee7c
 fi
c0ee7c
 
c0ee7c
-- 
c0ee7c
2.18.4
c0ee7c