podman create/run need to load information from the image

We should be pulling information out of the image to set the
defaults to use when setting up the container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #110
Approved by: mheon
This commit is contained in:
Daniel J Walsh
2017-12-18 12:05:06 -05:00
committed by Atomic Bot
parent 8aeb38e4a7
commit 00d38cb379
12 changed files with 553 additions and 205 deletions

View File

@ -307,6 +307,19 @@ func WithSELinuxLabels(processLabel, mountLabel string) CtrCreateOption {
}
}
// WithUser sets the user identity field in configutation
// Valid uses [user | user:group | uid | uid:gid | user:gid | uid:group ]
func WithUser(user string) CtrCreateOption {
return func(ctr *Container) error {
if ctr.valid {
return ErrCtrFinalized
}
ctr.config.User = user
return nil
}
}
// WithRootFSFromImage sets up a fresh root filesystem using the given image
// If useImageConfig is specified, image volumes, environment variables, and
// other configuration from the image will be added to the config