mirror of
https://github.com/containers/podman.git
synced 2025-12-05 21:10:35 +08:00
Vendor in latest projectatomic/buildah
buildah fixed its probelm where it was not pulling in the ENV of the base image. This pulls that change into libpod as well. Signed-off-by: umohnani8 <umohnani@redhat.com> Closes: #832 Approved by: mheon
This commit is contained in:
35
vendor/github.com/projectatomic/buildah/new.go
generated
vendored
35
vendor/github.com/projectatomic/buildah/new.go
generated
vendored
@@ -54,7 +54,7 @@ func reserveSELinuxLabels(store storage.Store, id string) error {
|
||||
}
|
||||
return err
|
||||
}
|
||||
// Prevent containers from using same MCS Label
|
||||
// Prevent different containers from using same MCS label
|
||||
if err := label.ReserveLabel(b.ProcessLabel); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -133,6 +133,22 @@ func imageManifestAndConfig(ctx context.Context, ref types.ImageReference, syste
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
func newContainerIDMappingOptions(idmapOptions *IDMappingOptions) storage.IDMappingOptions {
|
||||
var options storage.IDMappingOptions
|
||||
if idmapOptions != nil {
|
||||
options.HostUIDMapping = idmapOptions.HostUIDMapping
|
||||
options.HostGIDMapping = idmapOptions.HostGIDMapping
|
||||
uidmap, gidmap := convertRuntimeIDMaps(idmapOptions.UIDMap, idmapOptions.GIDMap)
|
||||
if len(uidmap) > 0 && len(gidmap) > 0 {
|
||||
options.UIDMap = uidmap
|
||||
options.GIDMap = gidmap
|
||||
} else {
|
||||
options.HostUIDMapping = true
|
||||
options.HostGIDMapping = true
|
||||
}
|
||||
}
|
||||
return options
|
||||
}
|
||||
func newBuilder(ctx context.Context, store storage.Store, options BuilderOptions) (*Builder, error) {
|
||||
var ref types.ImageReference
|
||||
var img *storage.Image
|
||||
@@ -258,6 +274,8 @@ func newBuilder(ctx context.Context, store storage.Store, options BuilderOptions
|
||||
}
|
||||
|
||||
coptions := storage.ContainerOptions{}
|
||||
coptions.IDMappingOptions = newContainerIDMappingOptions(options.IDMappingOptions)
|
||||
|
||||
container, err := store.CreateContainer("", []string{name}, imageID, "", "", &coptions)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "error creating container")
|
||||
@@ -278,6 +296,9 @@ func newBuilder(ctx context.Context, store storage.Store, options BuilderOptions
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
uidmap, gidmap := convertStorageIDMaps(container.UIDMap, container.GIDMap)
|
||||
namespaceOptions := DefaultNamespaceOptions()
|
||||
namespaceOptions.AddOrReplace(options.NamespaceOptions...)
|
||||
|
||||
builder := &Builder{
|
||||
store: store,
|
||||
@@ -293,7 +314,17 @@ func newBuilder(ctx context.Context, store storage.Store, options BuilderOptions
|
||||
ProcessLabel: processLabel,
|
||||
MountLabel: mountLabel,
|
||||
DefaultMountsFilePath: options.DefaultMountsFilePath,
|
||||
CommonBuildOpts: options.CommonBuildOpts,
|
||||
NamespaceOptions: namespaceOptions,
|
||||
ConfigureNetwork: options.ConfigureNetwork,
|
||||
CNIPluginPath: options.CNIPluginPath,
|
||||
CNIConfigDir: options.CNIConfigDir,
|
||||
IDMappingOptions: IDMappingOptions{
|
||||
HostUIDMapping: len(uidmap) == 0,
|
||||
HostGIDMapping: len(uidmap) == 0,
|
||||
UIDMap: uidmap,
|
||||
GIDMap: gidmap,
|
||||
},
|
||||
CommonBuildOpts: options.CommonBuildOpts,
|
||||
}
|
||||
|
||||
if options.Mount {
|
||||
|
||||
Reference in New Issue
Block a user