DoDiODev opened a new pull request, #9090:
URL: https://github.com/apache/devlake/pull/9090

   ### Summary
   
   `docker-compose-dev-mysql.yml` and `docker-compose-dev-postgresql.yml` pull 
the pre-built `devlake-dashboard` and `devlake-config-ui` images through 
`devlake.docker.scarf.sh`. Scarf is a gateway that records download analytics 
for the project. Some environments (corporate registries, air-gapped mirrors, 
privacy policies) need to pull those images directly instead.
   
   This PR introduces `DEVLAKE_IMAGE_REGISTRY` so the registry prefix can be 
overridden, while keeping the Scarf gateway as the default:
   
   ```yaml
   image: 
${DEVLAKE_IMAGE_REGISTRY:-devlake.docker.scarf.sh}/apache/devlake-dashboard:latest
   image: 
${DEVLAKE_IMAGE_REGISTRY:-devlake.docker.scarf.sh}/apache/devlake-config-ui:latest
   ```
   
   ```bash
   # opt out, pull straight from Docker Hub
   DEVLAKE_IMAGE_REGISTRY=docker.io docker compose -f 
docker-compose-dev-mysql.yml up
   ```
   
   3 files changed, +13/-4.
   
   ### Why the `env.example` entry is commented out
   
   The three services read `./.env` via `env_file`. An **active** assignment 
there would not only drive the image substitution, it would also be injected as 
an environment variable into the running `devlake`, `config-ui` and `grafana` 
containers — a behaviour change unrelated to the goal. The default therefore 
lives inline in the compose files, and `env.example` only documents the knob.
   
   ### Validation
   
   Rendered with Docker Compose 5.5.0 / Docker 29.5.3, for both compose files:
   
   | Case | Result |
   |---|---|
   | Variable unset, existing `.env` from `main` | `docker compose config` 
**byte-identical** to `main` |
   | `.env` copied from the new `env.example` | **byte-identical** to `main` |
   | `DEVLAKE_IMAGE_REGISTRY=docker.io` in `.env` | 
`docker.io/apache/devlake-{dashboard,config-ui}:latest` |
   | `DEVLAKE_IMAGE_REGISTRY=ghcr.io/example` in the shell | 
`ghcr.io/example/apache/devlake-…:latest` |
   | Empty value | falls back to the Scarf default (`:-` semantics) |
   
   Both endpoints were confirmed to resolve: `docker manifest inspect` succeeds 
for `devlake.docker.scarf.sh/apache/devlake-dashboard:latest`, and the Docker 
Hub registry API returns `200` for `apache/devlake-dashboard` and 
`apache/devlake-config-ui`, so the opt-out target really exists.
   
   `env.example` still parses cleanly as a dotenv file, both compose files 
parse as YAML, and the commit message matches the `lint-commit-message` pattern.
   
   ### Deliberately out of scope
   
   - `devops/releases/lake-v0.*/docker-compose.yml` — released artifacts, 
pinned to historical versions.
   - `.devcontainer/docker-compose.yml` — Compose reads `.env` relative to that 
file, so a root-level `.env` would not apply; changing it would only look 
configurable.
   - Every other image (`mysql`, `postgres`, `oauth2-proxy`, `mericodev/*`) 
keeps its existing registry.
   
   No functional change for anyone who does not set the variable.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to