Files
computer-playbook/compose/cache.override.yml
T
kevinveenbirkenbachandClaude Opus 5.5 624ef48e8e feat(cache): let the registry cache pull from Docker Hub with an operator account
Two GUI lanes died on Docker Hub "toomanyrequests" on 2026-10-30 while the registry cache pulled anonymously from the shared host IPv4 bucket. compose/cache.override.yml hardcoded AUTH_REGISTRIES to "" (the image's Dockerfile sets placeholder accounts, so the empty value must stay explicit).

AUTH_REGISTRIES now reads INFINITO_CACHE_REGISTRY_AUTH, a static passthrough key whose default.env value is empty, so an unset or empty value renders the cache byte-identically to before and recreates no container. The operator sets auth.docker.io:<user>:<token> in custom.env; rpardini/docker-registry-proxy 0.6.5 adds the credentials to the token requests for auth.docker.io only. cache.md documents the Repo Public Read-only token, rotation via make dotenv and make compose-up, the log check, and where the value is visible. test_registry_cache_auth.py renders the real compose files with a temporary custom.env and asserts the value reaches registry-cache only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 17:52:08 +01:00

117 lines
4.4 KiB
YAML

---
# Layered on compose.yml by the dev tooling when the cache stack is
# active. See docs/contributing/environment/cache.md.
services:
registry-cache:
image: rpardini/docker-registry-proxy:0.6.5
container_name: infinito-registry-cache
environment:
ENABLE_MANIFEST_CACHE: "true"
AUTH_REGISTRIES: ${INFINITO_CACHE_REGISTRY_AUTH}
REGISTRIES: ${INFINITO_CACHE_REGISTRIES:?Run 'make dotenv' to generate the .env single source of truth}
CACHE_MAX_SIZE: "${INFINITO_CACHE_REGISTRY_MAX_SIZE:?Run 'make dotenv' to generate the .env single source of truth}"
DISABLE_IPV6: "true"
volumes:
- type: bind
source: ${INFINITO_CACHE_REGISTRY_HOST_PATH:?Run 'make dotenv' to generate the .env single source of truth}
target: /docker_mirror_cache
bind:
create_host_path: true
- type: bind
source: ${INFINITO_CACHE_REGISTRY_CA_HOST_PATH:?Run 'make dotenv' to generate the .env single source of truth}
target: /ca
bind:
create_host_path: true
healthcheck:
test:
- CMD-SHELL
- "wget -qO- http://127.0.0.1:3128/ca.crt >/dev/null 2>&1"
interval: 5s
timeout: 3s
retries: 30
start_period: 30s
networks:
default:
ipv4_address: ${INFINITO_CACHE_REGISTRY_IP:?Run 'make dotenv' to generate the .env single source of truth}
restart: unless-stopped
package-cache:
image: sonatype/nexus3:3.91.1-ubi
container_name: ${INFINITO_CACHE_PACKAGE_CONTAINER:?Run 'make dotenv' to generate the .env single source of truth}
user: "0:0"
environment:
INSTALL4J_ADD_VM_PARAMS: "-Xms${INFINITO_CACHE_PACKAGE_HEAP:?Run 'make dotenv' to generate the .env single source of truth} -Xmx${INFINITO_CACHE_PACKAGE_HEAP:?Run
'make dotenv' to generate the .env single source of truth} -XX:MaxDirectMemorySize=${INFINITO_CACHE_PACKAGE_DIRECT_MEM:?Run 'make dotenv' to generate the
.env single source of truth}"
NEXUS_SECURITY_RANDOMPASSWORD: "false"
volumes:
- type: bind
source: ${INFINITO_CACHE_PACKAGE_HOST_PATH:?Run 'make dotenv' to generate the .env single source of truth}
target: /nexus-data
bind:
create_host_path: true
ports:
- "${INFINITO_BIND_IP:?Run 'make dotenv' to generate the .env single source of truth}:${INFINITO_CACHE_PACKAGE_PORT:?Run 'make dotenv' to generate the .env
single source of truth}:8081"
healthcheck:
test:
- CMD-SHELL
- "curl -fsS http://127.0.0.1:8081/service/rest/v1/status >/dev/null"
interval: 5s
timeout: 3s
retries: 60
start_period: 120s
networks:
default:
ipv4_address: ${INFINITO_CACHE_PACKAGE_IP:?Run 'make dotenv' to generate the .env single source of truth}
restart: unless-stopped
package-cache-frontend:
image: nginx:1.27-alpine
container_name: infinito-package-cache-frontend
depends_on:
package-cache:
condition: service_healthy
volumes:
- type: bind
source: ${INFINITO_CACHE_PACKAGE_FRONTEND_CA_DIR:?Run 'make dotenv' to generate the .env single source of truth}
target: /etc/nginx/ca
read_only: true
bind:
create_host_path: true
- type: bind
source: ${INFINITO_CACHE_PACKAGE_FRONTEND_CERTS_DIR:?Run 'make dotenv' to generate the .env single source of truth}
target: /etc/nginx/certs
read_only: true
bind:
create_host_path: true
- ${INFINITO_CACHE_PACKAGE_FRONTEND_CONF:?Run 'make dotenv' to generate the .env single source of truth}:/etc/nginx/conf.d/upstreams.conf:ro
networks:
default:
ipv4_address: ${INFINITO_CACHE_PACKAGE_FRONTEND_IP:?Run 'make dotenv' to generate the .env single source of truth}
healthcheck:
test:
- CMD-SHELL
- "wget -qO- --no-check-certificate https://127.0.0.1/ --header 'Host: pypi.org' >/dev/null 2>&1 || exit 0"
interval: 5s
timeout: 3s
retries: 30
start_period: 10s
restart: unless-stopped
infinito:
depends_on:
registry-cache:
condition: service_healthy
required: false
package-cache:
condition: service_healthy
required: false
package-cache-frontend:
condition: service_healthy
required: false
extends:
file: compose.cache-consumer.yml
service: cache-consumer