Korbs revised this gist 11 months ago. Go to revision
1 file changed, 27 insertions
README.md(file created)
| @@ -0,0 +1,27 @@ | |||
| 1 | + | # Buildah - Build and Push | |
| 2 | + | ||
| 3 | + | ## Build | |
| 4 | + | ||
| 5 | + | To build an OCI image, use the `build` option and name the OCI image with the `-t` tag variable: | |
| 6 | + | ```bash | |
| 7 | + | buildah build -t registry.whatever.org/image-name | |
| 8 | + | ``` | |
| 9 | + | ||
| 10 | + | You can also add metadata to it like a description with the `--annotation` variable, by adding: | |
| 11 | + | ```bash | |
| 12 | + | --annotation 'org.opencontainers.image.description=Description of the OCI image' | |
| 13 | + | ``` | |
| 14 | + | ||
| 15 | + | > View more metadata options for OCI images: https://github.com/opencontainers/image-spec/blob/main/annotations.md#back-compatibility-with-label-schema | |
| 16 | + | ||
| 17 | + | To add another metadata, such as the vendor, you would simply add another `--annotation` variable. Here's a full example: | |
| 18 | + | ```bash | |
| 19 | + | buildah build -t registry.whatever.org/image-name --annotation 'org.opencontainers.image.description=Description of the OCI image' --annotation 'org.opencontainers.image.vendor=Vendor Name' | |
| 20 | + | ``` | |
| 21 | + | ||
| 22 | + | ## Push | |
| 23 | + | ||
| 24 | + | It's straight-forward with the `push` option. Just push: | |
| 25 | + | ``` | |
| 26 | + | buildah push registry.whatever.org/image-name | |
| 27 | + | ``` | |
Newer
Older