mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
move pull and import to a job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
This commit is contained in:
parent
9d44298c5e
commit
9dcbdbc4b1
8 changed files with 107 additions and 45 deletions
|
|
@ -2,8 +2,6 @@ package docker
|
|||
|
||||
import (
|
||||
"github.com/dotcloud/docker"
|
||||
"github.com/dotcloud/docker/utils"
|
||||
"io/ioutil"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
|
@ -53,5 +51,8 @@ func generateImage(name string, srv *docker.Server) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.ImageImport("-", "repo", name, archive, ioutil.Discard, utils.NewStreamFormatter(true))
|
||||
job := srv.Eng.Job("import", "-", "repo", name)
|
||||
job.Stdin.Add(archive)
|
||||
job.SetenvBool("json", true)
|
||||
return job.Run()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue