Skip to content

Commit

Permalink
Support host configuration for docker-daemon sources and destinations
Browse files Browse the repository at this point in the history
This PR adds CLI support for overriding the default docker daemon host when using the
`docker-daemon` transport.

Additionally, to support daemons listening on plain HTTP only, it is possible to
specify the scheme as part of the host URL, e.g. `http+tcp://localhost:2375`

I'm not sure if this is a good idea - I needed a way to stop the httpClient from
trying to use TLS, and this seemed like a reasonable approach, similar to how the
python docker client behaves. Happy to discuss and iterate on this.

I'm guessing that I'd need to sumbit that part upstream to `containers/image` anyway.

Fixes containers#244
  • Loading branch information
jlsalmon committed Mar 30, 2018
1 parent c61482d commit 731b194
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
10 changes: 10 additions & 0 deletions cmd/skopeo/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,15 @@ var copyCmd = cli.Command{
Name: "dest-compress",
Usage: "Compress tarball image layers when saving to directory using the 'dir' transport. (default is same compression type as source)",
},
cli.StringFlag{
Name: "src-daemon-host",
Value: "",
Usage: "use docker daemon host at `HOST` (docker-daemon sources only)",
},
cli.StringFlag{
Name: "dest-daemon-host",
Value: "",
Usage: "use docker daemon host at `HOST` (docker-daemon destinations only)",
},
},
}
3 changes: 3 additions & 0 deletions cmd/skopeo/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ func contextFromGlobalOptions(c *cli.Context, flagPrefix string) (*types.SystemC
OCISharedBlobDirPath: c.String(flagPrefix + "shared-blob-dir"),
DirForceCompress: c.Bool(flagPrefix + "compress"),
AuthFilePath: c.String("authfile"),
DockerDaemonHost: c.String(flagPrefix + "daemon-host"),
DockerDaemonCertPath: c.String(flagPrefix + "cert-dir"),
DockerDaemonInsecureSkipTLSVerify: !c.BoolT(flagPrefix + "tls-verify"),
}
if c.IsSet(flagPrefix + "tls-verify") {
ctx.DockerInsecureSkipTLSVerify = !c.BoolT(flagPrefix + "tls-verify")
Expand Down
10 changes: 8 additions & 2 deletions vendor/github.com/containers/image/docker/daemon/client.go

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

0 comments on commit 731b194

Please sign in to comment.