mirror of
https://github.com/containers/podman.git
synced 2025-12-02 02:58:03 +08:00
short-name aliasing
Add support for short-name aliasing. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
20
vendor/github.com/containers/buildah/run_linux.go
generated
vendored
20
vendor/github.com/containers/buildah/run_linux.go
generated
vendored
@@ -23,6 +23,7 @@ import (
|
||||
"github.com/containernetworking/cni/libcni"
|
||||
"github.com/containers/buildah/bind"
|
||||
"github.com/containers/buildah/chroot"
|
||||
"github.com/containers/buildah/copier"
|
||||
"github.com/containers/buildah/pkg/overlay"
|
||||
"github.com/containers/buildah/pkg/secrets"
|
||||
"github.com/containers/buildah/util"
|
||||
@@ -165,11 +166,6 @@ func (b *Builder) Run(command []string, options RunOptions) error {
|
||||
spec := g.Config
|
||||
g = nil
|
||||
|
||||
logrus.Debugf("ensuring working directory %q exists", filepath.Join(mountPoint, spec.Process.Cwd))
|
||||
if err = os.MkdirAll(filepath.Join(mountPoint, spec.Process.Cwd), 0755); err != nil && !os.IsExist(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
// Set the seccomp configuration using the specified profile name. Some syscalls are
|
||||
// allowed if certain capabilities are to be granted (example: CAP_SYS_CHROOT and chroot),
|
||||
// so we sorted out the capabilities lists first.
|
||||
@@ -184,6 +180,15 @@ func (b *Builder) Run(command []string, options RunOptions) error {
|
||||
}
|
||||
rootIDPair := &idtools.IDPair{UID: int(rootUID), GID: int(rootGID)}
|
||||
|
||||
mode := os.FileMode(0755)
|
||||
coptions := copier.MkdirOptions{
|
||||
ChownNew: rootIDPair,
|
||||
ChmodNew: &mode,
|
||||
}
|
||||
if err := copier.Mkdir(mountPoint, filepath.Join(mountPoint, spec.Process.Cwd), coptions); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
bindFiles := make(map[string]string)
|
||||
namespaceOptions := append(b.NamespaceOptions, options.NamespaceOptions...)
|
||||
volumes := b.Volumes()
|
||||
@@ -1981,7 +1986,6 @@ func (b *Builder) configureEnvironment(g *generate.Generator, options RunOptions
|
||||
}
|
||||
|
||||
func setupRootlessSpecChanges(spec *specs.Spec, bundleDir string, shmSize string) error {
|
||||
spec.Hostname = ""
|
||||
spec.Process.User.AdditionalGids = nil
|
||||
spec.Linux.Resources = nil
|
||||
|
||||
@@ -2137,10 +2141,6 @@ func checkAndOverrideIsolationOptions(isolation Isolation, options *RunOptions)
|
||||
logrus.Debugf("Forcing use of a user namespace.")
|
||||
}
|
||||
options.NamespaceOptions.AddOrReplace(NamespaceOption{Name: string(specs.UserNamespace)})
|
||||
if ns := options.NamespaceOptions.Find(string(specs.UTSNamespace)); ns != nil && !ns.Host {
|
||||
logrus.Debugf("Disabling UTS namespace.")
|
||||
}
|
||||
options.NamespaceOptions.AddOrReplace(NamespaceOption{Name: string(specs.UTSNamespace), Host: true})
|
||||
case IsolationOCI:
|
||||
pidns := options.NamespaceOptions.Find(string(specs.PIDNamespace))
|
||||
userns := options.NamespaceOptions.Find(string(specs.UserNamespace))
|
||||
|
||||
Reference in New Issue
Block a user