[PATCH 1/2] docker: Check for /.dockerenv too

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



/.dockerinit may no longer exist.

Ref https://github.com/moby/moby/issues/18355
---
 Makefile.am             | 1 +
 tests/docker/.dockerenv | 0
 virt-what.in            | 2 +-
 3 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 tests/docker/.dockerenv

diff --git a/Makefile.am b/Makefile.am
index 67502fc..6408cfd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -101,6 +101,7 @@ EXTRA_DIST = \
 	tests/bhyve/sbin/dmidecode \
 	tests/bhyve/sbin/uname \
 	tests/bhyve/sbin/virt-what-cpuid-helper \
+	tests/docker/.dockerenv \
 	tests/docker/.dockerinit \
 	tests/docker/proc/cpuinfo \
 	tests/docker/proc/self/status \
diff --git a/tests/docker/.dockerenv b/tests/docker/.dockerenv
new file mode 100644
index 0000000..e69de29
diff --git a/virt-what.in b/virt-what.in
index f685461..f871cc1 100644
--- a/virt-what.in
+++ b/virt-what.in
@@ -336,7 +336,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
 
-- 
2.17.1

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux