|
| 1 | +## Podman Entitlement GitHub Action |
| 2 | + |
| 3 | +When building container images that install Red Hat content |
| 4 | +which is not part of Universal Base Image repositories, |
| 5 | +Red Hat entitlements are needed to access the full Red Hat Enterprise Linux |
| 6 | +repositories. |
| 7 | + |
| 8 | +To avoid modifying the Dockerfiles with extra steps that would |
| 9 | +handle the registration, this Action registers a temporary system |
| 10 | +using organization's activation key, and uses `/etc/containers/mounts.conf` |
| 11 | +to configure subsequent `podman build` invocations to have access |
| 12 | +to the entitlements. |
| 13 | + |
| 14 | +## Inputs |
| 15 | + |
| 16 | +| Input | Description | |
| 17 | +| --- | --- | |
| 18 | +| `org` | Red Hat account organization | |
| 19 | +| `activationkey` | Red Hat account activation key | |
| 20 | +| `image` | Container image to use to run `subscription-manager register` with the above parameters <br> Optional, defaults to `registry.access.redhat.com/ubi9` | |
| 21 | + |
| 22 | +## Usage |
| 23 | + |
| 24 | +On https://access.redhat.com/management/activation_keys, create |
| 25 | +new Subscription Manager activation key. |
| 26 | + |
| 27 | +Set up secrets in your repository, for example `redhat_org` for your |
| 28 | +Red Hat account organization and `redhat_activationkey` for your Red Hat |
| 29 | +account activation key. Your Organization ID is shown on the above-mentioned |
| 30 | +Activation Keys page on Red Hat portal. |
| 31 | + |
| 32 | +In your workflow YAML which calls `podman build`, add invocation |
| 33 | +of `redhat-actions/common/podman-entitlement` before that `podman build` |
| 34 | +step: |
| 35 | + |
| 36 | +```yaml |
| 37 | + - uses: redhat-actions/common/podman-entitlement |
| 38 | + with: |
| 39 | + org: ${{ secrets.redhat_org }} |
| 40 | + activationkey: ${{ secrets.redhat_activationkey }} |
| 41 | + - run: podman build -t localhost/the-image:the-tag src |
| 42 | +``` |
| 43 | +
|
0 commit comments