Skip to content

Commit

Permalink
The rootfs needs to be unpacked in order to properly resolve uids/gid…
Browse files Browse the repository at this point in the history
…s for chowning purposes, otherwise /etc/passwd isn't found, or wouldn't have the users/groups from the base image
  • Loading branch information
pmcq committed Jan 7, 2019
1 parent e15d5dc commit 04ea1cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/commands/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ type CopyCommand struct {
snapshotFiles []string
}

func (c *CopyCommand) RequiresUnpackedFS() bool {
// We want to unpack the root filesystem if the copy command is going
// to require resolving UIDs or GIDs that might have been defined
// in the base image
return c.cmd.Chown != ""
}

func (c *CopyCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error {
// Resolve from
if c.cmd.From != "" {
Expand Down

1 comment on commit 04ea1cd

@pmcq
Copy link
Author

@pmcq pmcq commented on 04ea1cd Jan 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This relates to this issue - GoogleContainerTools#477

Please sign in to comment.