diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-05-01 12:08:52 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-05-03 12:23:12 +0000 |
commit | ab7e2a695633dbe45b0af3332b813b0efdfbf203 (patch) | |
tree | 74de1a9b76fbc3ab628f083561ed60c2576836be /libpod/container_commit.go | |
parent | 16c997de624be049dda5d2182ec70d979194b002 (diff) | |
download | podman-ab7e2a695633dbe45b0af3332b813b0efdfbf203.tar.gz podman-ab7e2a695633dbe45b0af3332b813b0efdfbf203.tar.bz2 podman-ab7e2a695633dbe45b0af3332b813b0efdfbf203.zip |
Store user Volumes, Entrypoint, Command in database
We need these for commit, and they cannot be properly deduced
from just the OCI spec, so save them in the database so we can
retrieve them for commit.
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Closes: #700
Approved by: rhatdan
Diffstat (limited to 'libpod/container_commit.go')
-rw-r--r-- | libpod/container_commit.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libpod/container_commit.go b/libpod/container_commit.go index 354aff8b9..568fad9f7 100644 --- a/libpod/container_commit.go +++ b/libpod/container_commit.go @@ -26,7 +26,7 @@ type ContainerCommitOptions struct { // Commit commits the changes between a container and its image, creating a new // image -func (c *Container) Commit(ctx context.Context, destImage string, options ContainerCommitOptions, mounts, command, entryPoint []string) (*image.Image, error) { +func (c *Container) Commit(ctx context.Context, destImage string, options ContainerCommitOptions) (*image.Image, error) { if !c.batched { c.lock.Lock() defer c.lock.Unlock() @@ -74,14 +74,10 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai // add it to the resulting image. // Entrypoint - always set this first or cmd will get wiped out - if len(entryPoint) > 0 { - importBuilder.SetEntrypoint(entryPoint) - } + importBuilder.SetEntrypoint(c.config.Entrypoint) // Cmd - if len(command) > 0 { - importBuilder.SetCmd(command) - } + importBuilder.SetCmd(c.config.Command) // Env for _, e := range c.config.Spec.Process.Env { @@ -100,7 +96,7 @@ func (c *Container) Commit(ctx context.Context, destImage string, options Contai // User importBuilder.SetUser(c.User()) // Volumes - for _, v := range mounts { + for _, v := range c.config.UserVolumes { if v != "" { importBuilder.AddVolume(v) } |