diff --git a/cmd/skopeo/copy.go b/cmd/skopeo/copy.go index 28e8a3c0..274cfb4c 100644 --- a/cmd/skopeo/copy.go +++ b/cmd/skopeo/copy.go @@ -98,16 +98,6 @@ func copyCmd(global *globalOptions) 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)", - }, }, srcFlags...), destFlags...), } } diff --git a/cmd/skopeo/utils.go b/cmd/skopeo/utils.go index eddacdd9..d8c71c48 100644 --- a/cmd/skopeo/utils.go +++ b/cmd/skopeo/utils.go @@ -13,12 +13,13 @@ import ( // imageOptions collects CLI flags which are the same across subcommands, but may be different for each image // (e.g. may differ between the source and destination of a copy) type imageOptions struct { - global *globalOptions // May be shared across several imageOptions instances. - flagPrefix string // FIXME: Drop this eventually. - credsOption optionalString // username[:password] for accessing a registry - dockerCertPath string // A directory using Docker-like *.{crt,cert,key} files for connecting to a registry or a daemon - tlsVerify optionalBool // Require HTTPS and verify certificates (for docker: and docker-daemon:) - sharedBlobDir string // A directory to use for OCI blobs, shared across repositories + global *globalOptions // May be shared across several imageOptions instances. + flagPrefix string // FIXME: Drop this eventually. + credsOption optionalString // username[:password] for accessing a registry + dockerCertPath string // A directory using Docker-like *.{crt,cert,key} files for connecting to a registry or a daemon + tlsVerify optionalBool // Require HTTPS and verify certificates (for docker: and docker-daemon:) + sharedBlobDir string // A directory to use for OCI blobs, shared across repositories + dockerDaemonHost string // docker-daemon: host to connect to } // imageFlags prepares a collection of CLI flags writing into imageOptions, and the managed imageOptions structure. @@ -56,6 +57,11 @@ func imageFlags(global *globalOptions, flagPrefix, credsOptionAlias string) ([]c Usage: "`DIRECTORY` to use to share blobs across OCI repositories", Destination: &opts.sharedBlobDir, }, + cli.StringFlag{ + Name: flagPrefix + "daemon-host", + Usage: "use docker daemon host at `HOST` (docker-daemon: only)", + Destination: &opts.dockerDaemonHost, + }, }, &opts } @@ -69,7 +75,7 @@ func contextFromImageOptions(c *cli.Context, opts *imageOptions) (*types.SystemC OCISharedBlobDirPath: opts.sharedBlobDir, DirForceCompress: c.Bool(opts.flagPrefix + "compress"), AuthFilePath: c.String("authfile"), - DockerDaemonHost: c.String(opts.flagPrefix + "daemon-host"), + DockerDaemonHost: opts.dockerDaemonHost, DockerDaemonCertPath: opts.dockerCertPath, } if opts.tlsVerify.present {