Skip to content

Commit 56e4c09

Browse files
aseemannCybotTM
authored andcommitted
docs(registry-catalogue-and-pin-rot): add push-RBAC and tag-existence notes
Two facts surfaced during a /retro session, both fitting this file's existing "verify with the registry, don't guess" theme: - `composer:2-alpine` is not a real tag (composer:2 is already Alpine-based) — a reminder that a variant tag "should" exist is not the same as it existing. Also notes that an unqualified short image reference (e.g. composer:2 in a .env/build-arg) fails hard under non-interactive buildah/podman short-name resolution, unlike interactive use — fully qualify the registry instead. - A private-registry push failing "unauthorized" is a role question as often as a credential one. Harbor's own RBAC API answers this in two read-only calls instead of a build+push retry loop: a valid login with no membership entry (or role_id: null) on the target project means the account has zero role there, and no retry fixes that. Signed-off-by: Axel Seemann <axel.seemann@netresearch.de>
1 parent 4d819bb commit 56e4c09

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

skills/docker-development/references/registry-catalogue-and-pin-rot.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,37 @@ that exemption is written down:
7878
- **Testing the tag against the literal string `latest`.** `latest-rolling`,
7979
`latest-alpine` and friends float exactly as much and sail through. Treat a
8080
`latest-*` or `edge-*` prefix as floating.
81+
82+
## A tag that "should" exist can just not
83+
84+
Don't assume a variant tag exists because the pattern is common elsewhere —
85+
check the catalogue the same way as above. `composer:2-alpine` is not a real
86+
tag: the official `composer` image is Alpine-based *at* `composer:2`, so the
87+
`-alpine` suffix some other images use has nothing to pull. A short,
88+
unqualified reference like `composer:2` in a `.env`/build-arg also fails
89+
differently depending on where it resolves: buildah/podman running
90+
non-interactively enforce short-name resolution and refuse to guess a
91+
registry, erroring with "short-name resolution enforced but cannot prompt
92+
without a TTY" instead of defaulting to Docker Hub. Fully qualify it
93+
(`docker.io/library/composer:2`) rather than relying on the short name to
94+
resolve the same way it does interactively.
95+
96+
## A push failing "unauthorized" is a role question, not always a credential one
97+
98+
`unauthorized to access repository: <repo>, action: push` from a private
99+
registry (Harbor and similar) usually reads like a login problem, so the
100+
instinct is to re-check the password and rebuild. Ask the registry's own RBAC
101+
API first instead of spending a full build+push cycle per guess — Harbor
102+
answers this in two read-only calls:
103+
104+
```bash
105+
curl -s -u "$USER:$TOKEN" https://harbor.example.com/api/v2.0/users/current \
106+
| jq '.username'
107+
curl -s -u "$USER:$TOKEN" "https://harbor.example.com/api/v2.0/projects/<id>/members" \
108+
| jq '.[] | select(.entity_name=="'"$USER"'")'
109+
```
110+
111+
A valid login with no membership entry (or `role_id: null`) for the target
112+
project means the account has zero role there — no amount of retrying the
113+
push fixes that; someone with project-admin/Maintainer needs to grant a role
114+
(Developer is enough to push).

0 commit comments

Comments
 (0)