Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readme: Add more examples #22

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

# imagesync

A tool to copy/sync container images in registries without a demon.
A tool to copy/sync images in registries without a demon.

```bash
imagesync -h

NAME:
imagesync - Sync container images in registries.
imagesync - Sync images in registries.

USAGE:
imagesync [global options] command [command options] [arguments...]
Expand Down Expand Up @@ -45,17 +45,18 @@ GLOBAL OPTIONS:
You can download the binary from [releases](https://github.com/mqasimsarfraz/imagesync/releases) page and use it directly:

```bash
curl -L -O https://github.com/mqasimsarfraz/imagesync/releases/download/v1.2.0/imagesync_Linux_x86_64.tar.gz -o /tmp/imagesync_Linux_x86_64.tar.gz
tar -xvf /tmp/imagesync_Linux_x86_64.tar.gz
sudo mv /tmp/imagesync /usr/local/bin/
VERSION=$(curl -s https://api.github.com/repos/mqasimsarfraz/imagesync/releases/latest | jq -r .tag_name)
curl -sL https://github.com/mqasimsarfraz/imagesync/releases/download/${VERSION}/imagesync_Linux_x86_64.tar.gz | sudo tar -C /usr/local/bin -xzf - imagesync
imagesync -h
```

### Docker

You can use the docker image to run `imagesync`:

```bash
docker run --rm -it ghcr.io/mqasimsarfraz/imagesync:v1.2.0 -h
VERSION=$(curl -s https://api.github.com/repos/mqasimsarfraz/imagesync/releases/latest | jq -r .tag_name)
docker run --rm -it ghcr.io/mqasimsarfraz/imagesync:$VERSION -h
```

## Examples
Expand Down Expand Up @@ -85,16 +86,28 @@ imagesync -s testdata/alpine-oci -d localhost:5000/library/alpine:3

### Image Tag

#### container image
```
imagesync -s library/alpine:3 -d localhost:5000/library/alpine:3
```

#### helm chart
```
imagesync -s ghcr.io/nginxinc/charts/nginx-ingress:1.3.1 -d localhost:5000/nginxinc/charts/nginx-ingress:1.3.1
```

### Entire Repository

```
imagesync -s library/alpine -d localhost:5000/library/alpine
```

### Entire Repository (helm)

```
imagesync -s ghcr.io/nginxinc/charts/nginx-ingress -d localhost:5000/nginxinc/charts/nginx-ingress
```

## Private Registries

`imagesync` will respect the credentials stored in `~/.docker/config.json` via `docker login` etc. So in case you are
Expand Down
10 changes: 5 additions & 5 deletions imagesync.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@ var ErrInvalidTag = errors.New("invalid tag")
func Execute() error {
app := cli.NewApp()
app.Name = "imagesync"
app.Usage = "Sync container images in registries."
app.Usage = "Sync images in registries."
app.Version = Version

app.Flags = []cli.Flag{
cli.StringFlag{
Name: "src, s",
Usage: "Reference for the source container image/repository.",
Usage: "Reference for the source image/repository.",
Required: true,
},
cli.BoolFlag{
Name: "src-strict-tls",
Usage: "Enable strict TLS for connections to source container registry.",
Usage: "Enable strict TLS for connections to source registry.",
},
cli.StringFlag{
Name: "dest, d",
Usage: "Reference for the destination container repository.",
Usage: "Reference for the destination repository.",
Required: true,
},
cli.BoolFlag{
Name: "dest-strict-tls",
Usage: "Enable strict TLS for connections to destination container registry.",
Usage: "Enable strict TLS for connections to destination registry.",
},
cli.StringFlag{
Name: "tags-pattern",
Expand Down
Loading