Skip to content

Commit

Permalink
update docker/docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Maia committed Oct 10, 2019
1 parent 18af473 commit 369f088
Show file tree
Hide file tree
Showing 988 changed files with 135,431 additions and 31,980 deletions.
99 changes: 73 additions & 26 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 21 additions & 6 deletions internal/docker/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"os"
"path/filepath"
Expand Down Expand Up @@ -226,8 +227,8 @@ func SupportsBuildkit(v types.Version, env Env) bool {
// DOCKER_API_VERSION to set the version of the API to reach, leave empty for latest.
// DOCKER_CERT_PATH to load the TLS certificates from.
// DOCKER_TLS_VERIFY to enable or disable TLS verification, off by default.
func CreateClientOpts(ctx context.Context, env Env) ([]func(client *client.Client) error, error) {
result := make([]func(client *client.Client) error, 0)
func CreateClientOpts(ctx context.Context, env Env) ([]client.Opt, error) {
result := make([]client.Opt, 0)

if env.CertPath != "" {
options := tlsconfig.Options{
Expand Down Expand Up @@ -294,14 +295,18 @@ func (c *Cli) initCreds(ctx context.Context) dockerCreds {
if c.builderVersion == types.BuilderBuildKit {
session, _ := session.NewSession(ctx, "tilt", sessionSharedKey)
if session != nil {
session.Allow(authprovider.NewDockerAuthProvider())
session.Allow(authprovider.NewDockerAuthProvider(logger.Get(ctx).Writer(logger.DebugLvl)))
go func() {
defer func() {
_ = session.Close()
}()

// Start the server
_ = session.Run(ctx, c.Client.DialSession)
dialSession := func(ctx context.Context, proto string, meta map[string][]string) (net.Conn, error) {
return c.Client.DialHijack(ctx, "/session", proto, meta)
}
_ = session.Run(ctx, dialSession)
_ = session.Run(ctx, dialSession)
}()
creds.sessionID = session.ID()
}
Expand All @@ -311,7 +316,11 @@ func (c *Cli) initCreds(ctx context.Context) dockerCreds {
// If we fail to get credentials for some reason, that's OK.
// even the docker CLI ignores this:
// https://github.com/docker/cli/blob/23446275646041f9b598d64c51be24d5d0e49376/cli/command/image/build.go#L386
authConfigs, _ := configFile.GetAllCredentials()
credentials, _ := configFile.GetAllCredentials()
authConfigs := make(map[string]types.AuthConfig, len(credentials))
for k, auth := range credentials {
authConfigs[k] = types.AuthConfig(auth)
}
creds.authConfigs = authConfigs
}

Expand Down Expand Up @@ -370,7 +379,13 @@ func (c *Cli) ImagePush(ctx context.Context, ref reference.NamedTagged) (io.Read

logger.Get(ctx).Infof("Authenticating to image repo: %s", repoInfo.Index.Name)
infoWriter := logger.Get(ctx).Writer(logger.InfoLvl)
cli := command.NewDockerCli(nil, infoWriter, infoWriter, true)
cli, err := command.NewDockerCli(
command.WithCombinedStreams(infoWriter),
command.WithContentTrust(true),
)
if err != nil {
return nil, errors.Wrap(err, "ImagePush#NewDockerCli")
}

err = cli.Initialize(cliflags.NewClientOptions())
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions vendor/github.com/Microsoft/hcsshim/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions vendor/github.com/Microsoft/hcsshim/.gometalinter.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 13 additions & 5 deletions vendor/github.com/Microsoft/hcsshim/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 369f088

Please sign in to comment.