Skip to content

Commit 744e601

Browse files
committed
fix docker pull
1 parent 6f681bd commit 744e601

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

internal/template/docker.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/docker/docker/api/types/mount"
1616
"github.com/docker/docker/client"
1717
"github.com/docker/docker/pkg/stdcopy"
18+
"github.com/pkg/errors"
1819
"github.com/spf13/afero"
1920
)
2021

@@ -65,13 +66,15 @@ func (t *Template) executeActionStep(step Step, _ afero.Fs, outputFs afero.BaseP
6566

6667
fmt.Printf("%+v\n", cli)
6768

68-
writer := &DockerImageWriter{}
6969
reader, err := cli.ImagePull(ctx, step.Action, types.ImagePullOptions{})
7070
if err != nil {
7171
return err
7272
}
7373
defer reader.Close()
74-
io.Copy(writer, reader)
74+
_, err = io.Copy(os.Stdout, reader)
75+
if err != nil {
76+
return errors.Wrap(err, "error pull output to stdout")
77+
}
7578

7679
outputRealPath, err := outputFs.RealPath(".")
7780
if err != nil {

0 commit comments

Comments
 (0)