summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-04-30 08:26:31 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-30 21:07:59 +0000
commit9924956dc88bf91a4d0bf09249ffb4cb960dee01 (patch)
tree19c45c97a8af4ef47a65d28dcbf9a6ce5e2d1f77 /cmd/podman
parentc8c39779a7919e78a97b97394930080885a41425 (diff)
downloadpodman-9924956dc88bf91a4d0bf09249ffb4cb960dee01.tar.gz
podman-9924956dc88bf91a4d0bf09249ffb4cb960dee01.tar.bz2
podman-9924956dc88bf91a4d0bf09249ffb4cb960dee01.zip
do not commit default volumes from container
when performing a container commit, we should not add the default list of volumes for a container to the resulting image. it will cause the resulting image to crash when run subsequently. Signed-off-by: baude <bbaude@redhat.com> Closes: #699 Approved by: mheon
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/commit.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/cmd/podman/commit.go b/cmd/podman/commit.go
index 14b7ddace..105ab2d99 100644
--- a/cmd/podman/commit.go
+++ b/cmd/podman/commit.go
@@ -1,6 +1,7 @@
package main
import (
+ "encoding/json"
"fmt"
"io"
"os"
@@ -120,7 +121,17 @@ func commitCmd(c *cli.Context) error {
Changes: c.StringSlice("change"),
Author: c.String("author"),
}
- newImage, err := ctr.Commit(getContext(), reference, options)
+ 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)
if err != nil {
return err
}