diff options
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/build.go | 23 | ||||
-rw-r--r-- | cmd/podman/login.go | 3 | ||||
-rw-r--r-- | cmd/podman/spec.go | 3 |
3 files changed, 26 insertions, 3 deletions
diff --git a/cmd/podman/build.go b/cmd/podman/build.go index 0defb5e79..6e32a80e9 100644 --- a/cmd/podman/build.go +++ b/cmd/podman/build.go @@ -11,10 +11,24 @@ import ( var ( buildFlags = []cli.Flag{ + cli.StringFlag{ + Name: "authfile", + Usage: "path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json", + }, cli.StringSliceFlag{ Name: "build-arg", Usage: "`argument=value` to supply to the builder", }, + cli.StringFlag{ + Name: "cert-dir", + Value: "", + Usage: "use certificates at the specified path to access the registry", + }, + cli.StringFlag{ + Name: "creds", + Value: "", + Usage: "use `[username[:password]]` for accessing the registry", + }, cli.StringSliceFlag{ Name: "file, f", Usage: "`pathname or URL` of a Dockerfile", @@ -68,9 +82,18 @@ func buildCmd(c *cli.Context) error { budCmdArgs := []string{"bud"} + if c.IsSet("authfile") { + budCmdArgs = append(budCmdArgs, "--authfile", c.String("authfile")) + } for _, buildArg := range c.StringSlice("build-arg") { budCmdArgs = append(budCmdArgs, "--build-arg", buildArg) } + if c.IsSet("cert-dir") { + budCmdArgs = append(budCmdArgs, "--cert-dir", c.String("cert-dir")) + } + if c.IsSet("creds") { + budCmdArgs = append(budCmdArgs, "--creds", c.String("creds")) + } for _, fileName := range c.StringSlice("file") { budCmdArgs = append(budCmdArgs, "--file", fileName) } diff --git a/cmd/podman/login.go b/cmd/podman/login.go index 325bf8621..f57f34532 100644 --- a/cmd/podman/login.go +++ b/cmd/podman/login.go @@ -5,7 +5,6 @@ import ( "context" "fmt" "os" - "path/filepath" "strings" "github.com/containers/image/docker" @@ -75,7 +74,7 @@ func loginCmd(c *cli.Context) error { } sc.DockerInsecureSkipTLSVerify = !c.BoolT("tls-verify") if c.String("cert-dir") != "" { - sc.DockerCertPath = filepath.Join(c.String("cert-dir"), server) + sc.DockerCertPath = c.String("cert-dir") } if err = docker.CheckAuth(context.TODO(), sc, username, password, server); err == nil { diff --git a/cmd/podman/spec.go b/cmd/podman/spec.go index 341a50796..a14bd7dfb 100644 --- a/cmd/podman/spec.go +++ b/cmd/podman/spec.go @@ -572,7 +572,8 @@ func (c *createConfig) GetContainerCreateOptions() ([]libpod.CtrCreateOption, er return nil, errors.Wrapf(err, "container %q not found", c.NetMode.ConnectedContainer()) } options = append(options, libpod.WithNetNSFrom(connectedCtr)) - } else if !c.NetMode.IsHost() { + } else if !c.NetMode.IsHost() && !c.NetMode.IsNone() { + options = append(options, libpod.WithNetNS([]ocicni.PortMapping{})) options = append(options, libpod.WithNetNS(portBindings)) } |