summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-05-01 12:08:52 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-05-03 12:23:12 +0000
commitab7e2a695633dbe45b0af3332b813b0efdfbf203 (patch)
tree74de1a9b76fbc3ab628f083561ed60c2576836be /libpod/container_internal.go
parent16c997de624be049dda5d2182ec70d979194b002 (diff)
downloadpodman-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_internal.go')
-rw-r--r--libpod/container_internal.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 7631b80e8..8897b3cbf 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -198,6 +198,10 @@ func (c *Container) setupStorage(ctx context.Context) error {
c.config.StaticDir = containerInfo.Dir
c.state.RunDir = containerInfo.RunDir
+ // Set the default Entrypoint and Command
+ c.config.Entrypoint = containerInfo.Config.Config.Entrypoint
+ c.config.Command = containerInfo.Config.Config.Cmd
+
artifacts := filepath.Join(c.config.StaticDir, artifactsDir)
if err := os.MkdirAll(artifacts, 0755); err != nil {
return errors.Wrapf(err, "error creating artifacts directory %q", artifacts)
@@ -1144,7 +1148,7 @@ func (c *Container) setupOCIHooks(g *generate.Generator) error {
}
for _, hook := range ocihooks {
logrus.Debugf("SetupOCIHooks", hook)
- if hook.HasBindMounts && c.config.UserVolumes {
+ if hook.HasBindMounts && len(c.config.UserVolumes) > 0 {
if err := addHook(hook); err != nil {
return err
}