Skip to content

Commit

Permalink
manifest, push: implement --replicate with compression
Browse files Browse the repository at this point in the history
This is a proof-of-concept PR and needs few upstream PR from `c/image`.

Proof of concept PR to demonstrate and new API added in `c/image`.
Adds a new flag `--replicate <compression>` to `manifest push`, which when added
will push exisiting manifest on host while replicating the instances
with required `compression`.

Example usage

```console
./buildah manifest create localhost:5000/list:latest
./buildah build -t test .
./buildah manifest add localhost:5000/list:latest test
./buildah manifest push --tls-verify=false --all --replicate zstd localhost:5000/list:latest
```

Signed-off-by: Aditya R <[email protected]>
  • Loading branch information
flouthoc committed Jul 13, 2023
1 parent 9f3506d commit 56bda6b
Show file tree
Hide file tree
Showing 440 changed files with 33,937 additions and 49 deletions.
2 changes: 2 additions & 0 deletions cmd/buildah/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ func init() {
flags.StringVar(&manifestPushOpts.creds, "creds", "", "use `[username[:password]]` for accessing the registry")
flags.StringVar(&manifestPushOpts.digestfile, "digestfile", "", "after copying the image, write the digest of the resulting digest to the file")
flags.StringVarP(&manifestPushOpts.format, "format", "f", "", "manifest type (oci or v2s2) to attempt to use when pushing the manifest list (default is manifest type of source)")
flags.StringSliceVar(&manifestPushOpts.replicateWithCompression, "replicate", nil, "replicate instances with selected compression while pushing")
flags.BoolVarP(&manifestPushOpts.removeSignatures, "remove-signatures", "", false, "don't copy signatures when pushing images")
flags.StringVar(&manifestPushOpts.signBy, "sign-by", "", "sign the image using a GPG key with the specified `FINGERPRINT`")
flags.StringVar(&manifestPushOpts.signaturePolicy, "signature-policy", "", "`pathname` of signature policy file (not usually used)")
Expand Down Expand Up @@ -897,6 +898,7 @@ func manifestPush(systemContext *types.SystemContext, store storage.Store, listI
RemoveSignatures: opts.removeSignatures,
SignBy: opts.signBy,
ManifestType: manifestType,
ReplicateWithCompression: opts.replicateWithCompression,
}
if opts.all {
options.ImageListSelection = cp.CopyAllImages
Expand Down
1 change: 1 addition & 0 deletions cmd/buildah/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type pushOptions struct {
encryptionKeys []string
encryptLayers []int
insecure bool
replicateWithCompression []string
}

func init() {
Expand Down

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

3 changes: 3 additions & 0 deletions vendor/github.com/containers/image/v5/CODE-OF-CONDUCT.md

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

144 changes: 144 additions & 0 deletions vendor/github.com/containers/image/v5/CONTRIBUTING.md

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

6 changes: 6 additions & 0 deletions vendor/github.com/containers/image/v5/MAINTAINERS

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

93 changes: 93 additions & 0 deletions vendor/github.com/containers/image/v5/Makefile

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

82 changes: 82 additions & 0 deletions vendor/github.com/containers/image/v5/README.md

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

Loading

0 comments on commit 56bda6b

Please sign in to comment.