Skip to content

Commit

Permalink
ignore .dockerenv and .dockerinit
Browse files Browse the repository at this point in the history
  • Loading branch information
kvaps committed Dec 26, 2021
1 parent f85a48c commit a509373
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/util/fs_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ var defaultIgnoreList = []IgnoreListEntry{
Path: "/etc/mtab",
PrefixMatchOnly: false,
},
{
Path: "/.dockerenv",
PrefixMatchOnly: false,
},
{
Path: "/.dockerinit",
PrefixMatchOnly: false,
},
{
// we ingore /tmp/apt-key-gpghome, since the apt keys are added temporarily in this directory.
// from the base image
Expand Down
10 changes: 10 additions & 0 deletions pkg/util/fs_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ func Test_DetectFilesystemSkiplist(t *testing.T) {
{"/dev", false},
{"/dev/pts", false},
{"/sys", false},
{"/.dockerenv", false},
{"/.dockerinit", false},
{"/etc/mtab", false},
{"/tmp/apt-key-gpghome", true},
}
Expand Down Expand Up @@ -1513,6 +1515,14 @@ func TestInitIgnoreList(t *testing.T) {
Path: "/etc/mtab",
PrefixMatchOnly: false,
},
{
Path: "/.dockerenv",
PrefixMatchOnly: false,
},
{
Path: "/.dockerinit",
PrefixMatchOnly: false,
},
{
Path: "/tmp/apt-key-gpghome",
PrefixMatchOnly: true,
Expand Down

0 comments on commit a509373

Please sign in to comment.