You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Docker Registry与kwk前端搭建私有仓库后镜像不显示求助

Hey there! Let's troubleshoot why your registry frontend isn't showing the images you've pushed. I've run into this exact issue before, so here are the most common fixes to check:

1. Missing CORS Configuration on the Registry

The official Docker Registry doesn't enable CORS by default, and since your frontend makes API requests from the browser, cross-origin restrictions will block it from fetching image data. You need to add a CORS config to your Registry:

  • Create a config.yml file with these settings:
    version: 0.1
    http:
      headers:
        Access-Control-Allow-Origin: ['http://192.168.88.142']
        Access-Control-Allow-Methods: ['GET', 'POST', 'PUT', 'DELETE']
        Access-Control-Allow-Headers: ['Authorization']
        Access-Control-Expose-Headers: ['Docker-Content-Digest']
    
  • Mount this config when starting the Registry:
    docker run -d -p 5000:5000 \
      -v $(pwd)/config.yml:/etc/docker/registry/config.yml \
      -v registry-data:/var/lib/registry \
      registry:2
    

Make sure to replace http://192.168.88.142 with your frontend's actual address (include the port if you're not using 80).

2. Incorrect Registry Endpoint in Frontend Setup

Double-check that you're pointing the frontend to the correct Registry address. Don't use localhost here—since the frontend runs in a container, localhost refers to its own container, not your host machine.
Example frontend run command with the right parameters:

docker run -d -p 80:80 \
  -e REGISTRY_HOST=192.168.88.142 \
  -e REGISTRY_PORT=5000 \
  kwk/docker-registry-frontend
3. Verify the Registry API is Accessible

Test if the Registry's API is returning image data directly. Run this curl command or visit the URL in your browser:

curl http://192.168.88.142:5000/v2/_catalog

If you get a response like {"repositories":["your-image-name"]}, the Registry is working. If not, fix the Registry first before troubleshooting the frontend.

4. Browser Cache Interference

Sometimes browsers cache old API responses that show an empty registry. Try opening the frontend in incognito/private mode, or clear your browser's cache and reload the page.

5. Check Registry Storage Permissions

Even if you can push images, permission issues on the Registry's storage volume might prevent it from reading metadata properly. Check the Registry logs for errors:

docker logs <your-registry-container-id>

If you see permission-related messages, ensure the mounted volume has read/write access for the container's registry user (UID 10000).

内容的提问来源于stack exchange,提问作者quickshiftin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 03:35:18