Browse Source

replace mountinfo with findmnt

Fabian Peter Hammerle 5 years ago
parent
commit
fe7c867ef3
2 changed files with 4 additions and 2 deletions
  1. 3 1
      Dockerfile
  2. 1 1
      README.md

+ 3 - 1
Dockerfile

@@ -1,10 +1,12 @@
 FROM alpine:3.9
 
+RUN apk add --no-cache findmnt
+
 CMD set -x \
+    && findmnt --output TARGET,PROPAGATION --mountpoint /prop-test/vol \
     && mkdir -p /prop-test/src /prop-test/vol/mp \
     && mount --bind /prop-test/src /prop-test/vol/mp \
     && date -Is | tee /prop-test/src/mount-timestamp \
     && readlink /proc/self/ns/mnt | tee /prop-test/src/mntns \
     && readlink /proc/self/ns/user | tee /prop-test/src/userns \
-    && grep /prop-test /proc/self/mountinfo | tee /prop-test/src/mountinfo-container \
     && sleep 21m

+ 1 - 1
README.md

@@ -9,4 +9,4 @@ cat /tmp/prop-test-host/mp/mountinfo-container
 ```
 
 You may need to disable user namespace remapping `--userns host`
-due to https://github.com/moby/moby/issues/36472 .
+due to https://github.com/moby/moby/issues/36472#issuecomment-480388275 .