mirror of
https://github.com/containers/podman.git
synced 2025-09-27 00:34:32 +08:00
Vendor in latest containers/buildah
Fixes issues with builtin volumes having correct ownership and permissions when doing podman builds. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1525 Approved by: giuseppe
This commit is contained in:

committed by
Atomic Bot

parent
c4b15ce46b
commit
2d1b3e6c30
11
vendor/github.com/containers/buildah/run.go
generated
vendored
11
vendor/github.com/containers/buildah/run.go
generated
vendored
@ -506,10 +506,19 @@ func runSetupBuiltinVolumes(mountLabel, mountPoint, containerDir string, copyWit
|
||||
return nil, errors.Wrapf(err, "error relabeling directory %q for volume %q", volumePath, volume)
|
||||
}
|
||||
srcPath := filepath.Join(mountPoint, volume)
|
||||
stat, err := os.Stat(srcPath)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to stat %q for volume %q", srcPath, volume)
|
||||
}
|
||||
if err = os.Chmod(volumePath, stat.Mode().Perm()); err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to chmod %q for volume %q", volumePath, volume)
|
||||
}
|
||||
if err = os.Chown(volumePath, int(stat.Sys().(*syscall.Stat_t).Uid), int(stat.Sys().(*syscall.Stat_t).Gid)); err != nil {
|
||||
return nil, errors.Wrapf(err, "error chowning directory %q for volume %q", volumePath, volume)
|
||||
}
|
||||
if err = copyWithTar(srcPath, volumePath); err != nil && !os.IsNotExist(err) {
|
||||
return nil, errors.Wrapf(err, "error populating directory %q for volume %q using contents of %q", volumePath, volume, srcPath)
|
||||
}
|
||||
|
||||
}
|
||||
// Add the bind mount.
|
||||
mounts = append(mounts, specs.Mount{
|
||||
|
Reference in New Issue
Block a user