Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerbuild pull on Docker 1.9 is broken #10017

Merged
merged 1 commit into from
Jul 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions pkg/util/docker/dockerfile/builder/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {
}
from, err = e.CreateScratchImage()
if err != nil {
return err
return fmt.Errorf("unable to create a scratch image for this build: %v", err)
}
defer e.CleanupImage(from)
}
Expand Down Expand Up @@ -157,7 +157,7 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {
}
v, err := e.Client.CreateVolume(docker.CreateVolumeOptions{Name: volumeName})
if err != nil {
return err
return fmt.Errorf("unable to create volume to mount secrets: %v", err)
}
defer e.cleanupVolume(volumeName)
sharedMount = v.Mountpoint
Expand All @@ -181,7 +181,7 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {
}
container, err := e.Client.CreateContainer(opts)
if err != nil {
return err
return fmt.Errorf("unable to create build container: %v", err)
}
e.Container = container

Expand All @@ -200,7 +200,7 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {
})
}
if err := e.Copy(copies...); err != nil {
return err
return fmt.Errorf("unable to copy build context into container: %v", err)
}
}

Expand All @@ -223,7 +223,7 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {
}

if err := e.Client.StartContainer(e.Container.ID, &hostConfig); err != nil {
return err
return fmt.Errorf("unable to start build container: %v", err)
}
// TODO: is this racy? may have to loop wait in the actual run step
}
Expand All @@ -245,7 +245,7 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {
if mustStart {
glog.V(4).Infof("Stopping container %s ...", e.Container.ID)
if err := e.Client.StopContainer(e.Container.ID, 0); err != nil {
return err
return fmt.Errorf("unable to stop build container: %v", err)
}
}

Expand All @@ -272,7 +272,7 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {
Tag: tag,
})
if err != nil {
return err
return fmt.Errorf("unable to commit build container: %v", err)
}
e.Image = image
glog.V(4).Infof("Committed %s to %s", e.Container.ID, e.Image.ID)
Expand All @@ -293,7 +293,7 @@ func (e *ClientExecutor) Cleanup() error {
Force: true,
})
if _, ok := err.(*docker.NoSuchContainer); err != nil && !ok {
return err
return fmt.Errorf("unable to cleanup build container: %v", err)
}
e.Container = nil
return nil
Expand Down Expand Up @@ -389,7 +389,7 @@ func (e *ClientExecutor) LoadImage(from string) (*docker.Image, error) {
for _, config := range auth {
// TODO: handle IDs?
pullImageOptions := docker.PullImageOptions{
Repository: from,
Repository: repository,
Tag: tag,
OutputStream: imageprogress.NewPullWriter(outputProgress),
RawJSONStream: true,
Expand All @@ -406,7 +406,7 @@ func (e *ClientExecutor) LoadImage(from string) (*docker.Image, error) {
continue
}
if lastErr != nil {
return nil, lastErr
return nil, fmt.Errorf("unable to pull image (from: %s, tag: %s): %v", repository, tag, lastErr)
}

return e.Client.InspectImage(from)
Expand Down