-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
299 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Get a manifest digest. Example inputs: | ||
# - docker.stackable.tech/stackable/hello-world:0.0.1-SNAPSHOT-stackable0.0.0-dev | ||
# - docker.stackable.tech/stackable/hello-world:0.0.1-SNAPSHOT-stackable0.0.0-dev-amd64 | ||
set -euo pipefail | ||
|
||
# Note: `docker manifest push` currently outputs the same hash, but `manifest` | ||
# is experimental and the STDOUT is more likely to change than the structured | ||
# output. | ||
docker buildx imagetools inspect --format '{{println .Manifest.Digest}}' "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# `build-container-image` | ||
|
||
> Manifest: [build-container-image/action.yml][build-container-image] | ||
This action builds a *single* container image using `docker buildx build`. It does the following work: | ||
|
||
1. Free disk space to avoid running out of disk space during larger builds. | ||
2. Build the image using `docker buildx build`, outputting the architecture specific tag. | ||
|
||
This action is considered to be the **single** source of truth regarding the image manifest tag. | ||
All subsequent tasks must use this value to ensure consistency. | ||
|
||
## Inputs and Outputs | ||
|
||
> [!TIP] | ||
> For descriptions of the inputs and outputs, see the complete [build-container-image] action. | ||
### Inputs | ||
|
||
- `image-name` (eg: `kafka`) | ||
- `image-index-manifest-tag` (eg: `3.4.1-stackable0.0.0-dev`) | ||
- `container-file` (defaults to `Dockerfile`) | ||
- `build-context` (defaults to `.`) | ||
<!-- | ||
TODO (@NickLarsenNZ): Allow optional buildx cache | ||
- `build-cache-username` | ||
- `build-cache-password` | ||
--> | ||
|
||
### Outputs | ||
|
||
- `image-repository-uri` (eg: `localhost/kafka`) | ||
- `image-manifest-tag` (eg: `3.4.1-stackable0.0.0-dev-amd64`) | ||
- `image-manifest-uri` (eg: `localhost/kafka:3.4.1-stackable0.0.0-dev-amd64`) | ||
|
||
[build-container-image]: ./action.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# `build-product-image` | ||
|
||
> Manifest: [build-product-image/action.yml][build-product-image] | ||
<!-- markdownlint-disable-next-line MD028 --> | ||
> [!NOTE] | ||
> The build step is not concerned with registries, ports, paths to repositories, but still requires | ||
> a name. If the name does not contain a registry, `hub.docker.com` (?) is implied. Therefore, | ||
> `localhost` will be used as the registry so as to avoid accidental interactions with an unintended | ||
> registry. | ||
> | ||
> Ideally, bake should be refactored to use `localhost` as the registry for the previously mentioned | ||
> reason (whether or not that is behind some option). | ||
This action builds a *single* container image using `bake`. It does the following work: | ||
|
||
1. Free disk space to avoid running out of disk space during larger builds. | ||
2. Build the image using `bake` which internally uses `docker buildx`. | ||
3. Temporarily retag the image to use `localhost` instead of `docker.stackable.tech/stackable`. | ||
4. Produce output values to be used in later steps. | ||
|
||
This action is considered to be the **single** source of truth regarding image index tag and image | ||
manifest tag. All subsequent tasks must use these values to ensure consistency. | ||
|
||
Currently, bake provides the following ouput in the `bake-target-tags` file: | ||
|
||
```plain | ||
docker.stackable.tech/stackable/kafka:3.4.1-stackable0.0.0-dev-amd64 | ||
``` | ||
|
||
Until bake supports the ability to specify the registry, this action will retag the image as: | ||
|
||
```plain | ||
localhost/kafka:3.4.1-stackable0.0.0-dev-amd64 | ||
``` | ||
|
||
## Inputs and Outputs | ||
|
||
> [!TIP] | ||
> For descriptions of the inputs and outputs, see the complete [build-product-image] action. | ||
### Inputs | ||
|
||
- `product-name` (eg: `kafka`) | ||
- `product-version` (eg: `3.4.1`) | ||
- `image-tools-version` (eg: `0.0.13`) | ||
- `build-cache-username` (required) <!-- TODO: make the cache optional --> | ||
- `build-cache-password` (required) <!-- TODO: make the cache optional --> | ||
|
||
### Outputs | ||
|
||
- `image-manifest-tag` (eg: `3.4.1-stackable0.0.0-dev-amd64`) | ||
|
||
[build-product-image]: ./action.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.