Skip to content

Commit

Permalink
Add crane recipes.md (#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh committed Mar 4, 2021
1 parent 233b2d3 commit 3a77edb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/crane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ and registries.

<img src="../../images/crane.png" width="40%">

A collection of useful things you can do with `crane` is [here](cmd/crane/recipes.md).

## Installation

Download [latest release](https://github.com/google/go-containerregistry/releases/latest).
Expand Down
31 changes: 31 additions & 0 deletions cmd/crane/recipes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# `crane` Recipes

Useful tips and things you can do with `crane` and other standard tools.

### Extract a single file from an image

```
crane export ubuntu - | tar -Oxf - etc/passwd
```

Note: Be sure to remove the leading `/` from the path (not `/etc/passwd`)

### Bundle directory contents into an image

```
crane append -f <(tar -f - -c some-dir/) -t ${IMAGE}
```

By default, this produces an image with one layer containing the directory contents. Add `-b ${BASE_IMAGE}` to append the layer to a base image instead.

### Diff two configs

```
diff <(crane config busybox:1.32 | jq) <(crane config busybox:1.33 | jq)
```

### Diff two manifests

```
diff <(crane manifest busybox:1.32 | jq) <(crane manifest busybox:1.33 | jq)
```

0 comments on commit 3a77edb

Please sign in to comment.