Skip to content

Commit

Permalink
Merge pull request #16 from joshdk/readme-digest-update
Browse files Browse the repository at this point in the history
Readme with SHA256 digest examples
  • Loading branch information
joshdk committed Jul 17, 2018
2 parents 91b4680 + 2dc0be2 commit 09128ed
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $ go get -u github.com/joshdk/docker-retag
Alternatively, you can download a static Linux [release][github-release-link] binary by running:

```bash
$ wget -q https://github.com/joshdk/docker-retag/releases/download/0.0.1/docker-retag
$ wget -q https://github.com/joshdk/docker-retag/releases/download/0.0.2/docker-retag
$ sudo install docker-retag /usr/bin
```

Expand All @@ -46,30 +46,48 @@ $ export DOCKER_USER='joshdk'
$ export DOCKER_PASS='hunter2'
```

The credentials must have both pull and push access for the Docker repository you are retagging.

### Examples

There are three argument forms for this tool. The first separately specifies the image name, current tag, and desired new tag.
This tool can be used in a few simple ways. The simplest of which is using a
source image reference (similar to anything you could pass to `docker tag`) and
a target tag.

##### Referencing a source image by tag name.

```bash
$ docker-retag joshdk/hello-world 1.0.0 1.0.1
$ docker-retag joshdk/hello-world:1.0.0 1.0.1
Retagged joshdk/hello-world:1.0.0 as joshdk/hello-world:1.0.1
```

The second specifies the image name and current tag joined with a colon.
##### Referencing a source image by `sha256` digest.

```bash
$ docker-retag joshdk/hello-world:1.0.0 1.0.1
Retagged joshdk/hello-world:1.0.0 as joshdk/hello-world:1.0.1
$ docker-retag joshdk/hello-world@sha256:933f...3e90 1.0.1
Retagged joshdk/hello-world@sha256:933f...3e90 as joshdk/hello-world:1.0.1
```

The third defaults to `latest` if no tag is specified, similar to `docker pull`, etc.
##### Referencing an image only by name will default to using `latest`.

```bash
$ docker-retag joshdk/hello-world 1.0.1
Retagged joshdk/hello-world:latest as joshdk/hello-world:1.0.1
```

In all cases, the image and current tag **must** already exist in Docker Hub.
Additionally, you can pass the image name, source reference, and target tag as seperate arguments.

```bash
$ docker-retag joshdk/hello-world 1.0.0 1.0.1
Retagged joshdk/hello-world:1.0.0 as joshdk/hello-world:1.0.1
```

```bash
$ docker-retag joshdk/hello-world @sha256:933f...3e90 1.0.1
Retagged joshdk/hello-world@sha256:933f...3e90 as joshdk/hello-world:1.0.1
```

In all cases, the image and source reference **must** already exist in Docker Hub.

## License

Expand Down

0 comments on commit 09128ed

Please sign in to comment.