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

reformat installation shell snippets #1876

Closed
wants to merge 1 commit into from
Closed
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
24 changes: 12 additions & 12 deletions cmd/crane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ A collection of useful things you can do with `crane` is [here](recipes.md).
1. Get the [latest release](https://github.com/google/go-containerregistry/releases/latest) version.

```sh
$ VERSION=$(curl -s "https://api.github.com/repos/google/go-containerregistry/releases/latest" | jq -r '.tag_name')
VERSION=$(curl -s "https://api.github.com/repos/google/go-containerregistry/releases/latest" | jq -r '.tag_name')
```

or set a specific version:

```sh
$ VERSION=vX.Y.Z # Version number with a leading v
VERSION=vX.Y.Z # Version number with a leading v
```

1. Download the release.

```sh
$ OS=Linux # or Darwin, Windows
$ ARCH=x86_64 # or arm64, x86_64, armv6, i386, s390x
$ curl -sL "https://github.com/google/go-containerregistry/releases/download/${VERSION}/go-containerregistry_${OS}_${ARCH}.tar.gz" > go-containerregistry.tar.gz
OS=Linux # or Darwin, Windows
ARCH=x86_64 # or arm64, x86_64, armv6, i386, s390x
curl -sL "https://github.com/google/go-containerregistry/releases/download/${VERSION}/go-containerregistry_${OS}_${ARCH}.tar.gz" > go-containerregistry.tar.gz
```

1. Verify the signature. We generate [SLSA 3 provenance](https://slsa.dev) using
Expand All @@ -37,16 +37,16 @@ A collection of useful things you can do with `crane` is [here](recipes.md).
and verify as follows:

```sh
$ curl -sL https://github.com/google/go-containerregistry/releases/download/${VERSION}/multiple.intoto.jsonl > provenance.intoto.jsonl
$ # NOTE: You may be using a different architecture.
$ slsa-verifier-linux-amd64 verify-artifact go-containerregistry.tar.gz --provenance-path provenance.intoto.jsonl --source-uri github.com/google/go-containerregistry --source-tag "${VERSION}"
PASSED: Verified SLSA provenance
curl -sL https://github.com/google/go-containerregistry/releases/download/${VERSION}/multiple.intoto.jsonl > provenance.intoto.jsonl
# NOTE: You may be using a different architecture.
slsa-verifier-linux-amd64 verify-artifact go-containerregistry.tar.gz --provenance-path provenance.intoto.jsonl --source-uri github.com/google/go-containerregistry --source-tag "${VERSION}"
# NOTE: Output of the above command should equal: PASSED: Verified SLSA provenance
```

1. Unpack it in the PATH.

```sh
$ tar -zxvf go-containerregistry.tar.gz -C /usr/local/bin/ crane
tar -zxvf go-containerregistry.tar.gz -C /usr/local/bin/ crane
```

### Install manually
Expand All @@ -62,15 +62,15 @@ go install github.com/google/go-containerregistry/cmd/crane@latest
If you're macOS user and using [Homebrew](https://brew.sh/), you can install via brew command:

```sh
$ brew install crane
brew install crane
```

### Install on Arch Linux

If you're an Arch Linux user you can install via pacman command:

```sh
$ pacman -S crane
pacman -S crane
```

### Setup on GitHub Actions
Expand Down
Loading