Skip to content

Commit

Permalink
Merge pull request #22 from mqasimsarfraz/qasim/more-examples
Browse files Browse the repository at this point in the history
readme: Add more examples
  • Loading branch information
mqasimsarfraz authored Jul 30, 2024
2 parents 4229bed + 2dff510 commit a03a858
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
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

0 comments on commit a03a858

Please sign in to comment.