diff options
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/commit.go | 13 | ||||
-rw-r--r-- | cmd/podman/spec.go | 11 |
2 files changed, 11 insertions, 13 deletions
diff --git a/cmd/podman/commit.go b/cmd/podman/commit.go index 105ab2d99..14b7ddace 100644 --- a/cmd/podman/commit.go +++ b/cmd/podman/commit.go @@ -1,7 +1,6 @@ package main import ( - "encoding/json" "fmt" "io" "os" @@ -121,17 +120,7 @@ func commitCmd(c *cli.Context) error { Changes: c.StringSlice("change"), Author: c.String("author"), } - var createArtifact createConfig - artifact, err := ctr.GetArtifact("create-config") - if err == nil { - if err := json.Unmarshal(artifact, &createArtifact); err != nil { - return err - } - } - mounts := getMounts(createArtifact.Volumes, true) - command := createArtifact.Command - entryPoint := createArtifact.Entrypoint - newImage, err := ctr.Commit(getContext(), reference, options, strings.Split(mounts, ","), command, entryPoint) + newImage, err := ctr.Commit(getContext(), reference, options) if err != nil { return err } diff --git a/cmd/podman/spec.go b/cmd/podman/spec.go index fbe611cc3..e807ab642 100644 --- a/cmd/podman/spec.go +++ b/cmd/podman/spec.go @@ -653,9 +653,18 @@ func (c *createConfig) GetContainerCreateOptions() ([]libpod.CtrCreateOption, er } if len(c.Volumes) != 0 { - options = append(options, libpod.WithUserVolumes()) + options = append(options, libpod.WithUserVolumes(c.Volumes)) } + if len(c.Command) != 0 { + options = append(options, libpod.WithCommand(c.Command)) + } + + // Add entrypoint unconditionally + // If it's empty it's because it was explicitly set to "" or the image + // does not have one + options = append(options, libpod.WithEntrypoint(c.Entrypoint)) + if c.NetMode.IsContainer() { connectedCtr, err := c.Runtime.LookupContainer(c.NetMode.ConnectedContainer()) if err != nil { |