mirror of
https://github.com/containers/skopeo.git
synced 2025-09-06 01:00:43 +00:00
Add a global --registries.d option to skopeo
This is added pretty much only for integration tests right now; though, it might be useful also for non-root operation. Also makes a tiny cleanup of contextFromGlobalOptions, removing a variable.
This commit is contained in:
@@ -56,6 +56,11 @@ func createApp() *cli.App {
|
|||||||
Value: "",
|
Value: "",
|
||||||
Usage: "Path to a trust policy file",
|
Usage: "Path to a trust policy file",
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "registries.d",
|
||||||
|
Value: "",
|
||||||
|
Usage: "use registry configuration files in `DIR` (e.g. for docker signature storage)",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
app.Before = func(c *cli.Context) error {
|
app.Before = func(c *cli.Context) error {
|
||||||
if c.GlobalBool("debug") {
|
if c.GlobalBool("debug") {
|
||||||
|
@@ -8,10 +8,10 @@ import (
|
|||||||
|
|
||||||
// contextFromGlobalOptions returns a types.SystemContext depending on c.
|
// contextFromGlobalOptions returns a types.SystemContext depending on c.
|
||||||
func contextFromGlobalOptions(c *cli.Context) *types.SystemContext {
|
func contextFromGlobalOptions(c *cli.Context) *types.SystemContext {
|
||||||
certPath := c.GlobalString("cert-path")
|
|
||||||
tlsVerify := c.GlobalBool("tls-verify") // FIXME!! defaults to false
|
tlsVerify := c.GlobalBool("tls-verify") // FIXME!! defaults to false
|
||||||
return &types.SystemContext{
|
return &types.SystemContext{
|
||||||
DockerCertPath: certPath,
|
RegistriesDirPath: c.GlobalString("registries.d"),
|
||||||
|
DockerCertPath: c.GlobalString("cert-path"),
|
||||||
DockerInsecureSkipTLSVerify: !tlsVerify,
|
DockerInsecureSkipTLSVerify: !tlsVerify,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,6 +45,8 @@ Most commands refer to container images, using a _transport_`:`_details_ format.
|
|||||||
|
|
||||||
**--policy** _path-to-policy_ Path to a policy.json file to use for verifying signatures and deciding whether an image is trusted, overriding the default trust policy file.
|
**--policy** _path-to-policy_ Path to a policy.json file to use for verifying signatures and deciding whether an image is trusted, overriding the default trust policy file.
|
||||||
|
|
||||||
|
**--registries.d** _dir_ use registry configuration files in _dir_ (e.g. for docker signature storage), overriding the default path.
|
||||||
|
|
||||||
**--tls-verify** _bool-value_ Verify certificates
|
**--tls-verify** _bool-value_ Verify certificates
|
||||||
|
|
||||||
**--help**|**-h** Show help
|
**--help**|**-h** Show help
|
||||||
@@ -139,6 +141,10 @@ show help for `skopeo`
|
|||||||
Default trust policy file, if **--policy** is not specified.
|
Default trust policy file, if **--policy** is not specified.
|
||||||
The policy format is documented in https://github.com/containers/image/blob/master/docs/policy.json.md .
|
The policy format is documented in https://github.com/containers/image/blob/master/docs/policy.json.md .
|
||||||
|
|
||||||
|
**/etc/containers/registries.d**
|
||||||
|
Default directory containing registry configuration, if **--registries.d** is not specified.
|
||||||
|
The contents of this directory are documented in https://github.com/containers/image/blob/master/docs/registries.d.md .
|
||||||
|
|
||||||
# EXAMPLES
|
# EXAMPLES
|
||||||
|
|
||||||
## skopeo copy
|
## skopeo copy
|
||||||
|
Reference in New Issue
Block a user