Skip to content

Commit fb44f60

Browse files
committed
Documented credentials and setup for container registry push/pull
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent 3a5b5f4 commit fb44f60

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

build-in-container.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,35 @@ Images are hosted at `ghcr.io/cfengine` and versioned via `IMAGE_VERSION` in
121121
```
122122

123123
`--push-image` always builds with `--no-cache` to pick up the latest upstream
124-
packages, then pushes to the registry.
124+
packages, then pushes to the registry. However, you must be logged in to
125+
`ghcr.io` first. You can log in with a personal access token (classic) that has
126+
the write:packages scope. Alternatively, trigger the GitHub Actions workflow
127+
which handles authentication automatically.
128+
129+
#### GitHub Actions workflow
130+
131+
The `build-base-images.yml` workflow builds and pushes images for every
132+
supported platform. It is triggered manually via `workflow_dispatch`.
133+
134+
The workflow authenticates to `ghcr.io` using the automatic `GITHUB_TOKEN`
135+
provided by GitHub Actions. For this to work:
136+
137+
- The repository must grant `GITHUB_TOKEN` write access to packages. In the
138+
GitHub repository settings, go to **Actions → General → Workflow permissions**
139+
and select **Read and write permissions**.
140+
- After the first push, each package defaults to private. To allow anonymous
141+
pulls, go to the package on GitHub (**your org → Packages**), open **Package
142+
settings**, and change the visibility to **Public**. This is a one-time step
143+
per package — new tags (e.g. from bumping `IMAGE_VERSION`) inherit the
144+
existing visibility.
125145

126146
### Updating the toolchain
127147

128148
1. Edit `container/Dockerfile.debian` as needed
129149
2. Test locally with `--rebuild-image`
130150
3. Bump `IMAGE_VERSION` in `build-in-container.py`
131151
4. Commit the Dockerfile change + version bump
132-
5. Push new images with `--push-image` (or trigger the GitHub Actions workflow)
152+
5. Push new images by triggering the GitHub Actions workflow
133153

134154
## Debugging
135155

0 commit comments

Comments
 (0)