From 999af36a309935dae3c9db3b4da128dd00d10edb Mon Sep 17 00:00:00 2001 From: Ville Vesilehto Date: Fri, 12 Sep 2025 11:16:21 +0300 Subject: [PATCH] fix(compose): avoid pulling registry from Docker Hub (#437) ## Motivation and Context Previously running `docker-compose up` the first time, Docker would pull the official Docker Hub registry container, instead of building the MCP registry locally. This PR ensures the registry image is never pulled, and that it has a descriptive name locally without clashing with existing local container images. The `make dev-compose` command already enforces container build. This change only helps those who interface with the `docker-compose` configuration through other means. ## How Has This Been Tested? To validate the issue, clone the repository locally. Ensure none of the images referenced by `docker-compose` exist locally: ```bash docker rm -f registry postgres docker rmi registry postgres:16-alpine ``` Run `docker-compose up` without the `--build` flag. Notice that both `registry` and `postgres` images are pulled from Docker Hub. Registry prints the following start up logs - showing it's _a_ registry but of the wrong kind :) ``` registry | time="2025-09-11T11:16:23.966357009Z" level=debug msg="using \"text\" logging formatter" registry | time="2025-09-11T11:16:23.967075675Z" level=warning msg="No HTTP secret provided - generated random secret. This may cause problems with uploads if multiple registries are behind a load-balancer. To provide a shared secret, fill in http.secret in the configuration file or set the REGISTRY_HTTP_SECRET environment variable." environment=development go.version=go1.23.7 instance.id=566edec9-5208-4bd9-ab38-9e97d3f3b5b5 service=registry version=3.0.0 registry | time="2025-09-11T11:16:23.9671568Z" level=info msg="redis not configured" environment=development go.version=go1.23.7 instance.id=566edec9-5208-4bd9-ab38-9e97d3f3b5b5 service=registry version=3.0.0 registry | time="2025-09-11T11:16:23.967193342Z" level=info msg="Starting upload purge in 31m0s" environment=development go.version=go1.23.7 instance.id=566edec9-5208-4bd9-ab38-9e97d3f3b5b5 service=registry version=3.0.0 registry | time="2025-09-11T11:16:23.967215509Z" level=info msg="using inmemory blob descriptor cache" environment=development go.version=go1.23.7 instance.id=566edec9-5208-4bd9-ab38-9e97d3f3b5b5 service=registry version=3.0.0 registry | time="2025-09-11T11:16:23.967348634Z" level=info msg="providing prometheus metrics on /metrics" registry | time="2025-09-11T11:16:23.968138634Z" level=info msg="debug server listening :5001" registry | time="2025-09-11T11:16:23.9681758Z" level=info msg="listening on [::]:5000" environment=development go.version=go1.23.7 instance.id=566edec9-5208-4bd9-ab38-9e97d3f3b5b5 service=registry version=3.0.0 ``` Checkout the proposed change. When `docker-compose up` is ran it builds the registry container and launches it. ``` $ docker-compose up [+] Running 0/0 [+] Running 0/1stry Building 0.1s [+] Building 8.7s (18/18) FINISHED docker:desktop-linux ... registry | 2025/09/11 11:20:12 Starting MCP Registry Application vdev (commit: unknown) ... ``` ## Breaking Changes None. ## Types of changes - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist - [x] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [x] My code follows the repository's style guidelines - [x] New and existing tests pass locally - [ ] I have added appropriate error handling - [ ] I have added or updated documentation as needed ## Additional context Signed-off-by: Ville Vesilehto Co-authored-by: Radoslav Dimitrov --- docker-compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index d8e63c8..7e321dd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ services: registry: - image: registry + image: modelcontextprotocol/registry:dev + pull_policy: never container_name: registry build: dockerfile: Dockerfile