Skip to content

Commit 2f08be9

Browse files
committed
feat: add --image-parallel-copies flag
1 parent 04ca9ed commit 2f08be9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cmd/skopeo/copy.go

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ type copyOptions struct {
4444
encryptLayer []int // The list of layers to encrypt
4545
encryptionKeys []string // Keys needed to encrypt the image
4646
decryptionKeys []string // Keys needed to decrypt the image
47+
imageParallelCopies uint // Maximum number of parallel requests when copying images
4748
}
4849

4950
func copyCmd(global *globalOptions) *cobra.Command {
@@ -95,6 +96,7 @@ See skopeo(1) section "IMAGE NAMES" for the expected format
9596
flags.StringSliceVar(&opts.encryptionKeys, "encryption-key", []string{}, "*Experimental* key with the encryption protocol to use needed to encrypt the image (e.g. jwe:/path/to/key.pem)")
9697
flags.IntSliceVar(&opts.encryptLayer, "encrypt-layer", []int{}, "*Experimental* the 0-indexed layer indices, with support for negative indexing (e.g. 0 is the first layer, -1 is the last layer)")
9798
flags.StringSliceVar(&opts.decryptionKeys, "decryption-key", []string{}, "*Experimental* key needed to decrypt the image")
99+
flags.UintVar(&opts.imageParallelCopies, "image-parallel-copies", 0, "Maximum number of image layers to be copied (pulled/pushed) simultaneously. Not setting this field will fall back to containers/image defaults. (6)")
98100
return cmd
99101
}
100102

@@ -300,6 +302,7 @@ func (opts *copyOptions) run(args []string, stdout io.Writer) (retErr error) {
300302
OciDecryptConfig: decConfig,
301303
OciEncryptLayers: encLayers,
302304
OciEncryptConfig: encConfig,
305+
MaxParallelDownloads: opts.imageParallelCopies,
303306
})
304307
if err != nil {
305308
return err

docs/skopeo-copy.1.md

+4
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ The username to access the destination registry.
220220

221221
The password to access the destination registry.
222222

223+
**--image-parallel-copies** _n_
224+
225+
Maximum number of image layers to be copied (pulled/pushed) simultaneously. Not setting this field will fall back to containers/image defaults. (6)
226+
223227
## EXAMPLES
224228

225229
To just copy an image from one registry to another:

0 commit comments

Comments
 (0)