mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
imageservice: Add context to various methods
Co-authored-by: Paweł Gronowski <pawel.gronowski@docker.com> Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
committed by
Paweł Gronowski
parent
4c07d58592
commit
def549c8f6
@@ -1,6 +1,7 @@
|
||||
package daemon // import "github.com/docker/docker/daemon"
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"runtime"
|
||||
"strings"
|
||||
@@ -116,7 +117,7 @@ func merge(userConf, imageConf *containertypes.Config) error {
|
||||
// CreateImageFromContainer creates a new image from a container. The container
|
||||
// config will be updated by applying the change set to the custom config, then
|
||||
// applying that config over the existing container config.
|
||||
func (daemon *Daemon) CreateImageFromContainer(name string, c *backend.CreateImageConfig) (string, error) {
|
||||
func (daemon *Daemon) CreateImageFromContainer(ctx context.Context, name string, c *backend.CreateImageConfig) (string, error) {
|
||||
start := time.Now()
|
||||
container, err := daemon.GetContainer(name)
|
||||
if err != nil {
|
||||
@@ -146,7 +147,7 @@ func (daemon *Daemon) CreateImageFromContainer(name string, c *backend.CreateIma
|
||||
if c.Config == nil {
|
||||
c.Config = container.Config
|
||||
}
|
||||
newConfig, err := dockerfile.BuildFromConfig(c.Config, c.Changes, container.OS)
|
||||
newConfig, err := dockerfile.BuildFromConfig(ctx, c.Config, c.Changes, container.OS)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user