Skip to content

Commit

Permalink
sets inactivity timeout on push image
Browse files Browse the repository at this point in the history
  • Loading branch information
andrestc committed Mar 29, 2018
1 parent 10d1f04 commit 10eb7e5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions internal/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ import (
"fmt"
"os"
"strings"
"time"

"github.com/fsouza/go-dockerclient"
)

const defaultEndpoint = "unix:///var/run/docker.sock"
const (
defaultEndpoint = "unix:///var/run/docker.sock"
streamInactivityTimeout = time.Minute
)

type Container struct {
ID string
Expand Down Expand Up @@ -98,11 +102,11 @@ func (c *Client) Tag(ctx context.Context, img Image) error {

func (c *Client) Push(ctx context.Context, img Image) error {
opts := docker.PushImageOptions{
Name: img.Name(),
Tag: img.tag,
RawJSONStream: true,
OutputStream: os.Stdout,
Context: ctx,
Name: img.Name(),
Tag: img.tag,
OutputStream: os.Stdout,
Context: ctx,
InactivityTimeout: streamInactivityTimeout,
}
return c.api.PushImage(opts, docker.AuthConfiguration{})
}
Expand Down

0 comments on commit 10eb7e5

Please sign in to comment.