@@ -36,7 +36,7 @@ type Docker struct {
3636var _ builder.Backend = Docker {}
3737
3838// Pull tells Docker to pull image referenced by `name`.
39- func (d Docker ) Pull (name string ) (* image .Image , error ) {
39+ func (d Docker ) Pull (name string ) (builder .Image , error ) {
4040 ref , err := reference .ParseNamed (name )
4141 if err != nil {
4242 return nil , err
@@ -61,8 +61,16 @@ func (d Docker) Pull(name string) (*image.Image, error) {
6161 if err := d .Daemon .PullImage (ref , nil , pullRegistryAuth , ioutils .NopWriteCloser (d .OutOld )); err != nil {
6262 return nil , err
6363 }
64+ return d .GetImage (name )
65+ }
6466
65- return d .Daemon .GetImage (name )
67+ // GetImage looks up a Docker image referenced by `name`.
68+ func (d Docker ) GetImage (name string ) (builder.Image , error ) {
69+ img , err := d .Daemon .GetImage (name )
70+ if err != nil {
71+ return nil , err
72+ }
73+ return imgWrap {img }, nil
6674}
6775
6876// ContainerUpdateCmd updates Path and Args for the container with ID cID.
@@ -76,16 +84,14 @@ func (d Docker) ContainerUpdateCmd(cID string, cmd []string) error {
7684 return nil
7785}
7886
79- // Retain retains an image avoiding it to be removed or overwritten until a corresponding Release() call.
80- func (d Docker ) Retain (sessionID , imgID string ) {
81- // FIXME: This will be solved with tags in client-side builder
82- //d.Daemon.Graph().Retain(sessionID, imgID)
83- }
84-
85- // Release releases a list of images that were retained for the time of a build.
86- func (d Docker ) Release (sessionID string , activeImages []string ) {
87- // FIXME: This will be solved with tags in client-side builder
88- //d.Daemon.Graph().Release(sessionID, activeImages...)
87+ // ContainerAttach attaches streams to the container cID. If stream is true, it streams the output.
88+ func (d Docker ) ContainerAttach (cID string , stdin io.ReadCloser , stdout , stderr io.Writer , stream bool ) error {
89+ return d .Daemon .ContainerWsAttachWithLogs (cID , & daemon.ContainerWsAttachWithLogsConfig {
90+ InStream : stdin ,
91+ OutStream : stdout ,
92+ ErrStream : stderr ,
93+ Stream : stream ,
94+ })
8995}
9096
9197// BuilderCopy copies/extracts a source FileInfo to a destination path inside a container
0 commit comments