Skip to content

Commit

Permalink
feat(container): add image pull
Browse files Browse the repository at this point in the history
  • Loading branch information
Ric Featherstone authored and 06kellyjac committed Dec 21, 2023
1 parent ef6d53a commit b5e583b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/container/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ func (r simulator) Run(ctx context.Context, command []string) error {
return errors.Join(errors.New("failed to create docker client"), err)
}

out, err := cli.ImagePull(ctx, r.Config.Container.Image, types.ImagePullOptions{})
if err != nil {
return errors.Join(errors.New("failed to pull image"), err)
}
defer func(out io.ReadCloser) {
_ = out.Close()
}(out)

if _, err = io.Copy(os.Stdout, out); err != nil {
return errors.Join(errors.New("failed to pull image"), err)
}

mounts := []mount.Mount{
{
Type: mount.TypeBind,
Expand Down

0 comments on commit b5e583b

Please sign in to comment.