summaryrefslogtreecommitdiff
path: root/libpod/diff.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-05-07 15:17:33 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-05-15 03:56:38 -0400
commitb75bb4665e1c4db2bb3b931af04c099deec0f666 (patch)
treedbecc2cb2496eb02faa8733ce43cc8c013cb9800 /libpod/diff.go
parentfabaa256676d3cfb611f89922ccaf3405718a6f0 (diff)
downloadpodman-b75bb4665e1c4db2bb3b931af04c099deec0f666.tar.gz
podman-b75bb4665e1c4db2bb3b931af04c099deec0f666.tar.bz2
podman-b75bb4665e1c4db2bb3b931af04c099deec0f666.zip
Create the /etc/mtab file if does not exists
We should create the /etc/mtab->/proc/mountinfo link so that mount command will work within the container. Docker does this by default. Fixes: https://github.com/containers/podman/issues/10263 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod/diff.go')
-rw-r--r--libpod/diff.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/libpod/diff.go b/libpod/diff.go
index 6ce8d809a..c5a53478b 100644
--- a/libpod/diff.go
+++ b/libpod/diff.go
@@ -7,7 +7,7 @@ import (
"github.com/pkg/errors"
)
-var containerMounts = map[string]bool{
+var initInodes = map[string]bool{
"/dev": true,
"/etc/hostname": true,
"/etc/hosts": true,
@@ -17,6 +17,7 @@ var containerMounts = map[string]bool{
"/run/.containerenv": true,
"/run/secrets": true,
"/sys": true,
+ "/etc/mtab": true,
}
// GetDiff returns the differences between the two images, layers, or containers
@@ -36,7 +37,7 @@ func (r *Runtime) GetDiff(from, to string) ([]archive.Change, error) {
changes, err := r.store.Changes(fromLayer, toLayer)
if err == nil {
for _, c := range changes {
- if containerMounts[c.Path] {
+ if initInodes[c.Path] {
continue
}
rchanges = append(rchanges, c)