Skip to content

Commit

Permalink
fixed integration
Browse files Browse the repository at this point in the history
  • Loading branch information
itsManjeet committed Oct 19, 2023
1 parent 292ca4b commit 1937c7f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/builder/integrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ func (b *Builder) Integrate(container *container.Container, e *element.Element,
}
} else {

args := []string{"tar", "-xPhf", path.Join("/", "cache", path.Base(cachefile)), "-C", rootdir}
args := []string{"tar"}
if rootdir == "/" {
for _, exclude := range []string{"etc/hosts", "etc/hostname", "etc/resolve.conf", "proc", "sys", "dev", "run"} {
args = append(args, "--exclude='./"+exclude+"'")
args = append(args, "--exclude=./"+exclude)
}
}
args = append(args, "-xPhf", path.Join("/", "cache", path.Base(cachefile)), "-C", rootdir)

color.Process("Integrating %s, %s", e.Id, path.Base(cachefile))
if err := container.Execute(args...); err != nil {
Expand Down

0 comments on commit 1937c7f

Please sign in to comment.