1
0
mirror of https://github.com/containers/skopeo.git synced 2025-05-11 09:25:50 +00:00
Commit Graph

39 Commits

Author SHA1 Message Date
Adam Kaplan
ed0efc6932 feat: Add --retry-delay Option
- Add option to set a fixed delay between retries.
- Clarify that if delay is unset, skopeo uses an exponential delay for
  retries.

Fixes 

Signed-off-by: Adam Kaplan <adam.kaplan@redhat.com>
2025-01-16 22:39:25 +01:00
Ankit Agarwal
10a9e24d0e
* Added option to create digest file for syncing images.
* Digest file output would have docker reference of source
and sha of of the mainfest sync'd with the target. This
file would not be created if dry-run flag is enabled
* improved the sync document to include the correct output for manifest file.
* added new line for the manifest file once all images are sync'd
* Ensuring we log on manifest digest if the copy operation was successful.
* Check for errors if any once sync process is complete.
* Ensure to capture the failure when closing the manifest file.
* Ensure we are not writing manifest sha for failed copy of imagesand aborting the process in case write to file fails

Signed-off-by: Ankit Agarwal <aagarwal@cloudsmith.io>
2024-10-08 12:58:33 +01:00
Hussein Firas
177d4adb20 add kubasobon:semver changes
use single semver constraint

Signed-off-by: Hussein Firas <hussein.firas@loveholidays.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-01-19 23:36:34 +01:00
Miloslav Trmač
7b5876974a Emphasize the semantics of --preserve-digests a tiny bit
Fixes .

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-04-25 20:36:40 +02:00
Miloslav Trmač
30ecd8f040 Cross-link the top-level and subcommand option lists
... primarily to make the top-level options more discoverable.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-04-06 21:45:36 +02:00
dbeezt
fb0be61374 Corrected typo in skopeo-sync and updated description
Signed-off-by: dbeezt <dbrereton1995@gmail.com>
2023-02-22 15:30:02 +00:00
Toshiki Sonoda
83bcd13659 [CI:DOCS] Format manual page documents
- Add a prompt to the skopeo commands.

- Add a "console" identifier to fenced code
blocks which has a prompt, not "sh".

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-01-25 17:10:11 +09:00
Miloslav Trmač
bb1ac89327 Add support for Fulcio and Rekor, and --sign-by-sigstore=param-file
(skopeo copy) and (skopeo sync) now support --sign-by-sigstore=param-file,
using the containers-sigstore-signing-params.yaml(5) file format.

That notably adds support for Fulcio and Rekor signing.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-01-14 13:33:57 +01:00
Phil Corbett
35532b2404 Adds sync with tag suffix example
Signed-off-by: Phil Corbett <phil@phicorb.me.uk>
2022-11-17 17:49:27 +00:00
Phil Corbett
bdf1930221 Adds --append-suffix flag to sync
Signed-off-by: Phil Corbett <phil@phicorb.me.uk>
2022-11-13 13:57:38 +00:00
Miloslav Trmač
3450c11a0d Point at --all in the --preserve-digests option documentation
Fixes  .

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-08-23 19:12:32 +02:00
Miloslav Trmač
3a808c2ed5 Talk about "registry repositories" in (skopeo sync) documentation
- We don't sync complete registries.
- This should still refer to the remote registry servers.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-08-22 22:27:57 +02:00
Miloslav Trmač
f2b4071b1f Add --sign-by-sigstore-private-key to (skopeo copy) and (skopeo sync)
If a passphrase is not provided, prompt for one.

Outstanding:
- Should have integration tests.
- The signing options shared between copy and sync should live in utils.go.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-07-12 13:47:27 +02:00
Daniel J Walsh
c233a6dcb1
Add dry-run mode to skopeo-sync
Taking over  to drive it to completion.

Signed-off-by: Ted Wexler <twexler@bloomberg.net>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-03-28 14:18:10 -04:00
Miloslav Trmač
004519f143 Improve the documentation of boolean flags
The Go behavior of boolean flags is as follows:

Accepted values are --flag, which is the same as --flag=true, and --flag=false,
which is the default (except for OptionalBoolFlag).
--flag {false,true} is parsed as --flag=true with a non-option {false,true} argument.

So, for almost all flags, document them just as --flag, not
mentioning the [={false,true}] part, because users can just
omit =true, or the whole flag instead of =false.

OTOH, for tls-verify, document only the tls-verify={true,false}
variant, because the primary use is tls-verify=false, and because
tls-verify is not "the default", but equivalent to an explicit
tls-verify=true (overriding registries.conf).

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-02-01 02:16:45 +01:00
Valentin Rothberg
bb49923af4 prompt-less signing via passphrase file
To support signing images without prompting the user, add CLI flags for
providing a passphrase file.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2022-01-26 08:30:49 +01:00
James Hewitt
c582c4844f Add option to preserve digests on copy
When enabled, if digests can't be preserved an error will be raised.

Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
2021-12-07 13:16:10 +00:00
Jaikiran Pai
89ecd5a4c0 Introduce --username and --password to pass credentials 2021-10-07 20:31:59 +05:30
Jaikiran Pai
b950f83c60 issue#1466 - Introduce a --keep-going option to allow "sync" command to continue syncing even after a particular image sync fails 2021-10-05 07:18:38 +05:30
Daniel J Walsh
9edeb69f6a
Remove the extra (defaults to true) help msg
By default skopeo checks to see if the user actually uses one of the
--*tls-verify flags. Their initial value is ignored.  Setting the
initial value to false causes Cobra to not display the default value on
the screen when the user runs a `skopeo --help` command.

If the user does not specify a --*tls-verify option, it falls back to
using the value specified in the registries.conf file.

Fixes: https://github.com/containers/skopeo/issues/1383

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-08-27 06:16:50 -04:00
Ed Santiago
ae0595c56a
Man page validation: part 2 of 2
This is the script that runs 'skopeo COMMAND --help' and
cross-checks that all the option flags are documented
in man pages, and vice-versa (all options listed in man
pages appear in COMMAND's --help message).

Copied from podman, with changes for skopeo-land (removing
the rst checks, and conforming to skopeo conventions).

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-07-21 14:51:47 -04:00
Ed Santiago
e716b2fa66 man page checker - part 1 of 2
Add new script, hack/man-page-checker, copied from podman. Run it
in 'make validate-local' target.

This is NOT the checker requested in  (verify that flags
listed in 'skopeo foo --help' are documented in man pages and
vice-versa). This is a much simpler script that merely looks
for very basic typos or discrepancies between skopeo.1.md
and skopeo-foo.1.md.

The next part (cross-checking flags) is in progress but will
require a huge number of changes to the man pages. I'm submitting
this now because it's easy to review.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-06-29 13:07:42 -06:00
Jesse Rittner
c30b904cbe Add --retry-times to markdown docs
Fixes .

Signed-off-by: Jesse Rittner <rittneje@gmail.com>
2021-06-23 23:29:53 -04:00
Miloslav Trmač
5778d9bd67 Fix documentation of the --format option of skopeo copy and skopeo sync
It affects all transports; and without --format, we try several manifest formats.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-06-17 19:29:17 +02:00
Brendan Aye
7898ffaf23
Added format parameter to sync command
Signed-off-by: Brendan Aye <brendan.aye@t-mobile.com>
2021-04-28 10:54:21 -07:00
Josh Soref
4987a67293 Spelling
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-12-21 16:10:45 -05:00
Andrew DeMaria
873fbee01b
Fix Add --all sync flag to emulate copy --all
This replicates the --all copy flag to sync to perform the same
behavior. Namely, the default is CopySystemImage unless --all is passed
which changes the behavior to CopyAllImages. While it is probably
desirable for --all to be the default as there is no option to override
ones architecture with the sync command, --all can potentially break
existing sync incantations depending on registry support. Hence
CopySystemImage remains the default.

Signed-off-by: Andrew DeMaria <ademaria@cloudflare.com>
2020-11-16 15:18:56 -07:00
Andrew DeMaria
1a3eb478a7
Fix Add support for digests in sync
Signed-off-by: Andrew DeMaria <ademaria@cloudflare.com>
2020-11-16 15:18:53 -07:00
Alvaro Iradier
242b573f9a Adding periods 2020-09-18 18:11:01 +02:00
Alvaro Iradier
3c73c0c0cd Add --registry-token flags to support Bearer token authentication
Signed-off-by: Alvaro Iradier <airadier@gmail.com>
2020-09-18 11:42:54 +02:00
Yuhui Jiang
6198daeb2c
Correct a typo in docs/skopeo-sync.1.md
To disable TLS verification need to set "tls-verify" to "false"
2020-06-11 01:29:37 +08:00
Miloslav Trmač
72376c4144 Fix the recently added example in the man page.
- Improve the language
- Be consistent with the previous example about a trailing slash
- Don't unnecessarily quote :, it is not a shell metacharacter.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2020-05-25 11:58:19 +02:00
Miloslav Trmač
322625eeca Use a separate field for the "sync images with tag matching regex" feature
Fields that magically change their behavior depending on type of the value
are too much hassle for no benefit.

For now, this just copies&pastes the full loop in imagesToCopyFromRegistry
to create another loop handling the new ImagesByTagRegex field. Simplifications
to reduce duplication will follow.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2020-05-25 11:58:19 +02:00
zhangguanzhang
bec7f6977e Add tags to support regular expressions in yaml conf
add relevant test cases and documentation
update the sync doc
2020-05-20 09:23:00 +08:00
Daniel J Walsh
1b2de8ec5d
Update docs/skopeo-sync.1.md
Co-authored-by: Miloslav Trmač <mitr@redhat.com>
2020-05-15 07:42:54 -04:00
Daniel J Walsh
ab2300500a
Add links to configuration man pages
Help users discover additonal man pages by completing
SEE ALSO section.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-14 15:38:34 -04:00
Philipp Homann
55044627cc
Add example with repository
Fixes 

Signed-off-by: Philipp Homann <homann.philipp@googlemail.com>
2020-03-30 08:31:19 +02:00
Daniel Strobusch
4489ddd8a5 add specific authfile options to copy (and sync) command.
With additional prefixed flags for authfiles, it is possible to override the shared authfile flag to use different authfiles for src and dest registries. This is an important feature if the two registries have the same domain (but different paths) and require separate credentials.

Closes .

Signed-off-by: Daniel Strobusch <1847260+dastrobu@users.noreply.github.com>
2020-01-15 10:24:30 +01:00
Flavio Castelli
9c402f3799 Introduce the sync command
The skopeo sync command can sync images between a SOURCE and a
destination.

The purpose of this command is to assist with the mirroring of
container images from different docker registries to a single
docker registry.

Right now the following source/destination locations are implemented:

  * docker -> docker
  * docker-> dir
  * dir -> docker

The dir location is supported to handle the use case
of air-gapped environments.
In this context users can perform an initial sync on a trusted machine
connected to the internet; that would be a `docker` -> `dir` sync.
The target directory can be copied to a removable drive that can then be
plugged into a node of the air-gapped environment. From there a
`dir` -> `docker` sync will import all the images into the registry serving
the air-gapped environment.

Notes when specifying the `--scoped` option:

The image namespace is changed during the  `docker` to `docker` or `dir` copy.
The FQDN of the registry hosting the image will be added as new root namespace
of the image. For example, the image `registry.example.com/busybox:latest`
will be copied to
`registry.local.lan/registry.example.com/busybox:latest`.

The image namespace is not changed when doing a
`dir:` -> `docker` sync operation.

The alteration of the image namespace is used to nicely scope images
coming from different registries (the Docker Hub, quay.io, gcr,
other registries). That allows all of them to be hosted on the same
registry without incurring in clashes and making their origin explicit.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
Co-authored-by: Marco Vedovati <mvedovati@suse.com>
2019-12-02 13:42:39 +01:00