# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: DockerProxy
spec:
    description: Self-built Docker image acceleration service, one-click deployment of Docker, Ghcr, and other image acceleration/management services based on the official registry.
    icon: https://cdn.zeabur.com/templates/icon/dockerproxy.png
    readme: "# DockerProxy\nSelf-built Docker image acceleration service, enabling one-click deployment of Docker, K8s, Quay, Ghcr, Mcr, Elastic, Nvcr, and other image acceleration/management services based on the official registry.\n\n## How to use registry\nIf the source is: `docker.io/library/nginx:latest`,  \nReplace it with: `your_registry_domain/library/nginx:latest`.  \nCurrently, replacing `docker.io` and `ghcr.io` is supported.  \n\n## What can the WebUI do?\nThe WebUI allows you to view pulled images and provides detailed information about them.\n\n## What should I do if I need to proxy image registries other than docker.io and ghcr.io?\nOpen \"Config Edit\", change the `remoteurl` to the registry you need, and then restart the service.\n"
    services:
        - name: Registry-hub
          icon: https://cdn.zeabur.com/templates/icon/dockerproxy.png
          template: PREBUILT_V2
          spec:
            source:
                image: dqzboy/registry:latest
            ports:
                - id: registry
                  port: 5000
                  type: HTTP
            volumes:
                - id: data
                  dir: /var/lib/registry
            env:
                OTEL_TRACES_EXPORTER:
                    default: none
                    expose: false
            configs:
                - path: /etc/distribution/config.yml
                  template: "version: 0.1\nlog:\n  fields:\n    service: registry\nstorage:\n  filesystem:\n    rootdirectory: /var/lib/registry\n  #inmemory: #此存储驱动程序不会在运行期间保留任何数据,适合磁盘空间下的机器使用(但是会使用内存开销,只适合测试)\n  delete:\n    enabled: true\n  cache:\n    blobdescriptor: inmemory   \n    blobdescriptorsize: 10000\n  maintenance:\n    uploadpurging:\n      enabled: true\n      age: 168h\n      interval: 24h\n      dryrun: false\n    readonly:\n      enabled: false\nhttp:\n  addr: :5000\n  headers:\n    X-Content-Type-Options: [nosniff]\n    Access-Control-Allow-Origin: ['*']\n    Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS', 'DELETE']\n    Access-Control-Allow-Headers: ['Authorization', 'Accept', 'Cache-Control']\n    Access-Control-Max-Age: [1728000]\n    Access-Control-Allow-Credentials: [true]\n    Access-Control-Expose-Headers: ['Docker-Content-Digest']\n\nhealth:\n  storagedriver:\n    enabled: true\n    interval: 10s\n    threshold: 3\n\nproxy:\n  remoteurl: https://registry-1.docker.io\n  username: \n  password:\n  ttl: 168h  "
                  permission: null
                  envsubst: null
        - name: Registry-ghcr
          icon: https://cdn.zeabur.com/templates/icon/dockerproxy.png
          template: PREBUILT_V2
          spec:
            source:
                image: dqzboy/registry:latest
            ports:
                - id: registry
                  port: 5000
                  type: HTTP
            volumes:
                - id: data
                  dir: /var/lib/registry
            env:
                OTEL_TRACES_EXPORTER:
                    default: none
                    expose: false
            configs:
                - path: /etc/distribution/config.yml
                  template: "version: 0.1\nlog:\n  fields:\n    service: registry\nstorage:\n  filesystem:\n    rootdirectory: /var/lib/registry\n  #inmemory: #此存储驱动程序不会在运行期间保留任何数据,适合磁盘空间下的机器使用(但是会使用内存开销,只适合测试)\n  delete:\n    enabled: true\n  cache:\n    blobdescriptor: inmemory   \n    blobdescriptorsize: 10000\n  maintenance:\n    uploadpurging:\n      enabled: true\n      age: 168h\n      interval: 24h\n      dryrun: false\n    readonly:\n      enabled: false\nhttp:\n  addr: :5000\n  headers:\n    X-Content-Type-Options: [nosniff]\n    Access-Control-Allow-Origin: ['*']\n    Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS', 'DELETE']\n    Access-Control-Allow-Headers: ['Authorization', 'Accept', 'Cache-Control']\n    Access-Control-Max-Age: [1728000]\n    Access-Control-Allow-Credentials: [true]\n    Access-Control-Expose-Headers: ['Docker-Content-Digest']\n\nhealth:\n  storagedriver:\n    enabled: true\n    interval: 10s\n    threshold: 3\n\nproxy:\n  remoteurl: https://ghcr.io\n  username: \n  password:\n  ttl: 168h  "
                  permission: null
                  envsubst: null
        - name: Registry-webui
          icon: https://cdn.zeabur.com/templates/icon/dockerproxy.png
          template: PREBUILT_V2
          spec:
            source:
                image: dqzboy/docker-registry-ui:latest
            ports:
                - id: web
                  port: 8080
                  type: HTTP
            env:
                DOCKER_REGISTRY_URL:
                    default: http://registry-hub.zeabur.internal:5000
                    expose: false
                ENABLE_DELETE_IMAGES:
                    default: "true"
                    expose: false
                NO_SSL_VERIFICATION:
                    default: "true"
                    expose: false
                SECRET_KEY_BASE:
                    default: '{PASSWORD}'
                    expose: false
localization:
    zh-CN:
        description: 自建Docker镜像加速服务，基于官方 registry 一键部署Docker和Ghcr等镜像加速/管理服务。
        readme: "# DockerProxy\n自建Docker镜像加速服务，基于官方 registry 一键部署Docker、K8s、Quay、Ghcr、Mcr、elastic、nvcr等镜像加速/管理服。\n\n## 如何使用 Registry  \n如果来源为：`docker.io/library/nginx:latest`，  \n则替换为：`your_registry_domain/library/nginx:latest`。  \n目前支持替换 `docker.io` 和 `ghcr.io`。  \n\n## WebUI 可以做什么？\nWebUI 可以查看拉取过的镜像，以及镜像的详细信息。\n\n## 我需要代理除 docker.io 和 ghcr.io 以外的镜像站怎么办？\n打开「Config Edit」，将 `remoteurl` 改成你需要的镜像站，然后重启即可。\n"
    zh-TW:
        description: 自建 Docker 映像加速服務，基於官方 registry 一鍵部署Docker和Ghcr等映像加速/管理服務。
        readme: "# DockerProxy\n自建 Docker 映像加速服務，基於官方 registry 一鍵部署 Docker、K8s、Quay、Ghcr、Mcr、Elastic、Nvcr 等映像加速/管理服務。\n\n## 如何使用 Registry  \n如果來源為：`docker.io/library/nginx:latest`，  \n則替換為：`your_registry_domain/library/nginx:latest`。  \n目前支援替換 `docker.io` 和 `ghcr.io`。  \n\n## WebUI 可以做什麼？ \nWebUI 可以查看拉取過的鏡像，以及鏡像的詳細資訊。\n\n## 如果我需要代理除 docker.io 和 ghcr.io 以外的鏡像站怎麼辦？ \n打開「Config Edit」，將 `remoteurl` 改成你需要的鏡像站，然後重啟即可。"
