Add struct to configure Builder commit instead of using one defined in daemon

Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 7046651b87c0c028d010881abbb05a8f0c28ddfa
Component: engine
This commit is contained in:
Antonio Murdaca
2015-06-20 12:53:47 +02:00
parent a48d868c8f
commit 681944f56f
4 changed files with 36 additions and 12 deletions
+5 -6
View File
@@ -11,14 +11,13 @@ type ContainerCommitConfig struct {
Tag string
Author string
Comment string
Changes []string
Config *runconfig.Config
}
// Commit creates a new filesystem image from the current state of a container.
// The image can optionally be tagged into a repository
func (daemon *Daemon) Commit(container *Container, repository, tag, comment, author string, pause bool, config *runconfig.Config) (*image.Image, error) {
if pause && !container.IsPaused() {
func (daemon *Daemon) Commit(container *Container, c *ContainerCommitConfig) (*image.Image, error) {
if c.Pause && !container.IsPaused() {
container.Pause()
defer container.Unpause()
}
@@ -45,14 +44,14 @@ func (daemon *Daemon) Commit(container *Container, repository, tag, comment, aut
containerConfig = container.Config
}
img, err := daemon.graph.Create(rwTar, containerID, parentImageID, comment, author, containerConfig, config)
img, err := daemon.graph.Create(rwTar, containerID, parentImageID, c.Comment, c.Author, containerConfig, c.Config)
if err != nil {
return nil, err
}
// Register the image if needed
if repository != "" {
if err := daemon.repositories.Tag(repository, tag, img.ID, true); err != nil {
if c.Repo != "" {
if err := daemon.repositories.Tag(c.Repo, c.Tag, img.ID, true); err != nil {
return img, err
}
}