Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/ostree-ext/man/ostree-container-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ ostree-container-auth description of the registry authentication file
The OSTree container stack uses the same file formats as **containers-auth(5)** but
not the same locations.

When running as uid 0 (root), the tooling uses `/etc/ostree/auth.json` first, then looks
in `/run/ostree/auth.json`, and finally checks `/usr/lib/ostree/auth.json`.
When running as uid 0 (root), the tooling uses `/run/ostree/auth.json` first, then looks
in `/etc/ostree/auth.json`, and finally checks `/usr/lib/ostree/auth.json`.
For any other uid, the file paths used are in `${XDG_RUNTIME_DIR}/ostree/auth.json`.

In the future, it is likely that a path that is supported for both "system podman"
Expand Down
21 changes: 19 additions & 2 deletions docs/src/building/bootc-secrets.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# Secrets (e.g. container pull secrets)

To have `bootc` fetch updates from registry which requires authentication,
you must include a pull secret in one of `/etc/ostree/auth.json`,
`/run/ostree/auth.json` or `/usr/lib/ostree/auth.json`.
you must include a pull secret in one of `/run/ostree/auth.json`,
`/etc/ostree/auth.json` or `/usr/lib/ostree/auth.json`. They are checked
in this order.

The path to the authentication file differs from that used
by e.g. `podman` by default as some of the file paths used
Expand Down Expand Up @@ -43,6 +44,22 @@ as suggested by [this document](https://docs.aws.amazon.com/AmazonECR/latest/use
You can also use the machine-local persistent location `/etc/ostree/auth.json`
via this method.

## Persisting the pull secret with a transient /etc

If `/etc` is transient (see `bootc-setup-root-conf(5)`), changes to
`/etc/ostree/auth.json` will be lost on reboot. Instead, keep the pull
secret in `/var` and include a `tmpfiles.d` entry in the image that links
it into `/run/ostree/auth.json`, e.g.:

```
# /usr/lib/tmpfiles.d/bootc-auth.conf
d /var/lib/ostree 0700 root root -
L /run/ostree/auth.json - - - - /var/lib/ostree/auth.json
```

Then log in with `--authfile /var/lib/ostree/auth.json`. Note that this
pull secret will take precedence over one included in the image.

## Using a credential helper

In order to use a credential helper as configured in `registries.conf`
Expand Down
Loading