Skip to content

Commit 65a74c4

Browse files
committed
test: pull image from opencode
1 parent 39b8f3a commit 65a74c4

1 file changed

Lines changed: 38 additions & 3 deletions

File tree

.github/workflows/test-opencode.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,42 @@ on:
66
jobs:
77
probe:
88
runs-on: ubuntu-latest
9+
env:
10+
REGISTRY: registry.opencode.de
11+
GITLAB: https://gitlab.opencode.de
12+
IMG: bundesdruckerei-gmbh/plain-images/alpine
13+
TAG: "3.23"
14+
915
steps:
10-
- run: curl -s https://ifconfig.co/json | jq '{country,asn,org}' # wirklich US?
11-
- run: dig +short registry.opencode.de # welche IP? (nach 23.06 = neue)
12-
- run: docker pull registry.opencode.de/bundesdruckerei-gmbh/plain-images/alpine:3.23
16+
- name: Egress-Standort bestätigen
17+
continue-on-error: true
18+
run: |
19+
out=$(curl -fsS https://ipinfo.io/json) || { echo "ipinfo nicht erreichbar"; exit 0; }
20+
echo "$out" | jq '{country, region, org}' || echo "$out"
21+
22+
- name: DNS-Auflösung der Registry
23+
continue-on-error: true
24+
run: |
25+
getent hosts "$REGISTRY" || echo "Keine Auflösung für $REGISTRY"
26+
27+
- name: Registry erreichbar? (erwartet HTTP 401)
28+
continue-on-error: true
29+
run: |
30+
code=$(curl -s -o /dev/null -w "%{http_code}" "https://$REGISTRY/v2/")
31+
echo "GET /v2/ -> HTTP $code (401 = erreichbar + Auth-Realm aktiv)"
32+
33+
- name: Manifest anonym prüfen (public + Tag vorhanden?)
34+
continue-on-error: true
35+
run: |
36+
TOKEN=$(curl -fsS "$GITLAB/jwt/auth?service=container_registry&scope=repository:${IMG}:pull" | jq -r .token)
37+
code=$(curl -s -o /dev/null -w "%{http_code}" \
38+
-H "Authorization: Bearer $TOKEN" \
39+
-H "Accept: application/vnd.oci.image.index.v1+json,application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.oci.image.manifest.v1+json,application/vnd.docker.distribution.manifest.v2+json" \
40+
"https://$REGISTRY/v2/${IMG}/manifests/${TAG}")
41+
echo "Manifest ${IMG}:${TAG} -> HTTP $code (200 = anonym ziehbar)"
42+
43+
- name: Pull-Test (der eigentliche Beweis)
44+
run: |
45+
docker pull "$REGISTRY/$IMG:$TAG"
46+
docker image inspect "$REGISTRY/$IMG:$TAG" \
47+
--format 'OK: {{.Id}} ({{.Os}}/{{.Architecture}})'

0 commit comments

Comments
 (0)