{"id":21479277,"url":"https://github.com/rycus86/dockerhub-proxy","last_synced_at":"2026-02-02T07:43:14.788Z","repository":{"id":66144735,"uuid":"94490525","full_name":"rycus86/dockerhub-proxy","owner":"rycus86","description":"Python Flask application to proxy calls to the Docker Hub API.","archived":false,"fork":false,"pushed_at":"2024-11-03T03:06:03.000Z","size":30,"stargazers_count":3,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T03:24:06.919Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rycus86.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-16T00:50:24.000Z","updated_at":"2024-06-25T11:13:31.000Z","dependencies_parsed_at":"2024-05-07T04:22:21.917Z","dependency_job_id":"c16378c5-f519-43ad-ad29-858d32192eec","html_url":"https://github.com/rycus86/dockerhub-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rycus86/dockerhub-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fdockerhub-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fdockerhub-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fdockerhub-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fdockerhub-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rycus86","download_url":"https://codeload.github.com/rycus86/dockerhub-proxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fdockerhub-proxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263679238,"owners_count":23495014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T11:24:27.495Z","updated_at":"2026-02-02T07:43:14.756Z","avatar_url":"https://github.com/rycus86.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Hub Proxy\n\nA simple `Python` [Flask](http://flask.pocoo.org) *REST* server to proxy calls to *Docker Hub*.\n\n[![Build Status](https://travis-ci.org/rycus86/dockerhub-proxy.svg?branch=master)](https://travis-ci.org/rycus86/dockerhub-proxy)\n[![Build Status](https://img.shields.io/docker/build/rycus86/dockerhub-proxy.svg)](https://hub.docker.com/r/rycus86/dockerhub-proxy)\n[![Coverage Status](https://coveralls.io/repos/github/rycus86/dockerhub-proxy/badge.svg?branch=master)](https://coveralls.io/github/rycus86/dockerhub-proxy?branch=master)\n[![Code Climate](https://codeclimate.com/github/rycus86/dockerhub-proxy/badges/gpa.svg)](https://codeclimate.com/github/rycus86/dockerhub-proxy)\n\n## Usage\n\nThe *Docker Hub* API is implemented using [agithub](https://github.com/jpaugh/agithub) and supports\nauthenticated calls using these environment variables:\n\n- `DOCKERHUB_USERNAME`: a valid *Docker Hub* username\n- `DOCKERHUB_PASSWORD`: password for the same *Docker Hub* account\n- `DOCKERHUB_TOKEN`: alternatively an authenticated *Docker Hub* token can be used instead of\n  username and password\n\nTo get a reference to the `DockerHub` class use something like:\n```python\napi = DockerHub(username=os.environ.get('DOCKERHUB_USERNAME'),\n                password=os.environ.get('DOCKERHUB_PASSWORD'),\n                token=os.environ.get('DOCKERHUB_TOKEN'))\n```\n\nThe `api.DockerHub` class wraps endpoints with the following methods:\n\n- `get_user_details(username)`:\n  Returns the details of a *Docker Hub* user.\n- `get_repositories(username, \u003cpage_size\u003e, \u003climit\u003e)`:\n  Returns *all* the repositories of a user.  \n  It will paginate through pages having `page_size` results at most (default: `100`)\n  and will limit the total maximum results to `limit` (default: `10000`)\n- `get_repository(username, repository_name)`:\n  Returns the details of a single repository.\n- `get_tags(username, repository_name, \u003cpage_size\u003e, \u003climit\u003e)`:\n  Returns *all* the available tags of a repository.  \n  It will paginate through pages having `page_size` results at most (default: `100`)\n  and will limit the total maximum results to `limit` (default: `1000`)\n- `get_dockerfile(username, repository_name)`:\n  Returns the contents of the *raw Dockerfile* of a repository.\n- `get_autobuild_settings(username, repository_name)`:\n  Returns the autobuild settings of a repository.  \n  It will only work for autobuilds.\n- `get_comments(username, repository_name, \u003cpage_size\u003e, \u003climit\u003e)`:\n  Returns *all* the comments of a repository.\n  It will paginate through pages having `page_size` results at most (default: `100`)\n  and will limit the total maximum results to `limit` (default: `1000`)\n- `get_build_history(username, repository_name, \u003cpage_size\u003e, \u003climit\u003e)`:\n  Returns the details for *all* the builds of a repository.\n  It will paginate through pages having `page_size` results at most (default: `100`)\n  and will limit the total maximum results to `limit` (default: `1000`)\n- `get_build_details(username, repository_name, build_code)`:\n  Returns the details of a single build of a repository.\n\nThe `app` module is responsible for the *REST* presentation layer exposing *JSON* endpoints.\nThe exposed endpoints are cached using [Flask-Cache](https://pythonhosted.org/Flask-Cache).\n\nConfiguration options:\n\n- `HTTP_HOST`: the host (interface) for *Flask* to bind to (default: `127.0.0.1`)\n- `HTTP_PORT`: the port to bind to (default: `5000`)\n- `CORS_ORIGINS`: comma separated list of *origins* to allow *cross-domain* `GET` requests from\n  (default: `http://localhost:?.*`)\n\nTo allow connections from other hosts apart from `localhost` set the `HTTP_PORT` environment\nvariable to `0.0.0.0` or as appropriate.\n\nList of endpoints:\n\n- `/users/\u003cusername\u003e`:\n  returns the *Docker Hub* user's details\n- `/repositories/\u003cusername\u003e`:\n  returns the user's repositories\n- `/repositories/\u003cusername\u003e/\u003crepository\u003e`:\n  returns the details of a single repository\n- `/repositories/\u003cusername\u003e/\u003crepository\u003e/tags`:\n  returns the available tags of a repository\n- `/repositories/\u003cusername\u003e/\u003crepository\u003e/dockerfile`:\n  returns the *raw Dockerfile* of a repository (for autobuilds)\n- `/repositories/\u003cusername\u003e/\u003crepository\u003e/autobuild`:\n  returns the autobuild settings of a repository\n- `/repositories/\u003cusername\u003e/\u003crepository\u003e/comments`:\n  returns the comments of a repository\n- `/repositories/\u003cusername\u003e/\u003crepository\u003e/builds`:\n  returns the list of builds for a repository\n- `/repositories/\u003cusername\u003e/\u003crepository\u003e/builds/\u003cbuild_code\u003e`:\n  returns the details of a single build for a repository\n\n## Docker\n\nThe web application is built as a *Docker* image too based on *Alpine Linux*\nfor 3 architectures with the following tags:\n\n- `latest`: for *x86* hosts  \n  [![Layers](https://images.microbadger.com/badges/image/rycus86/dockerhub-proxy.svg)](https://microbadger.com/images/rycus86/dockerhub-proxy \"Get your own image badge on microbadger.com\")\n- `armhf`: for *32-bits ARM* hosts  \n  [![Layers](https://images.microbadger.com/badges/image/rycus86/dockerhub-proxy:armhf.svg)](https://microbadger.com/images/rycus86/dockerhub-proxy:armhf \"Get your own image badge on microbadger.com\")\n- `aarch64`: for *64-bits ARM* hosts  \n  [![Layers](https://images.microbadger.com/badges/image/rycus86/dockerhub-proxy:aarch64.svg)](https://microbadger.com/images/rycus86/dockerhub-proxy:aarch64 \"Get your own image badge on microbadger.com\")\n\n`latest` is auto-built on [Docker Hub](https://hub.docker.com/r/rycus86/dockerhub-proxy)\nwhile the *ARM* builds are uploaded from [Travis](https://travis-ci.org/rycus86/dockerhub-proxy).\n\nTo run it:\n```shell\ndocker run -d --name=\"dockerhub-proxy\" -p 5000:5000          \\\n  -e DOCKERHUB_USERNAME='user' -e DOCKERHUB_PASSWORD='pass'  \\\n  -e CORS_ORIGINS='http://site.example.com,*.website.com'    \\\n  rycus86/dockerhub-proxy:latest\n```\n\nOr with *docker-compose* (for a *Raspberry Pi* for example):\n```yaml\nversion: '2'\nservices:\n\n  dockerhub-proxy:\n    image: rycus86/dockerhub-proxy:armhf\n    read_only: true\n    expose:\n      - \"5000\"\n    restart: always\n    environment:\n      - HTTP_HOST=0.0.0.0\n    env_file:\n      - dockerhub-secrets.env\n```\n\nThis way you can keep the secrets in the `env_file` instead of passing them to the *Docker*\nclient from the command line.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frycus86%2Fdockerhub-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frycus86%2Fdockerhub-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frycus86%2Fdockerhub-proxy/lists"}