API to update a DockerHub repository's full desc based on a specified GitHub repository's README.md
50K+
readme-sync is a simple server that that provides an API to update a DockerHub repository's full description based on a specified GitHub repository's README.md, written in Go.
docker create --name=readmesync \
-v <path to config>:/config \
-p 80:80 \
antilax3/readme-sync
Two variants are built from the one Dockerfile, for linux/amd64 and linux/arm64.
| Variant | Base | Tags |
|---|---|---|
| wolfi | antilax3/wolfi | latest |
| alpine | antilax3/alpine | alpine |
Wolfi is the default. Both variants run the same statically linked binary, so the choice between them is only the base. Every build is also tagged BK<build>, with -alpine appended for the alpine variant.
The parameters are split into two halves, separated by a colon, the left hand side representing the host and the right the container side. For example with a volume -v external:internal - what this shows is the volume mapping from internal to external of the container. So -v /mnt/app/config:/config would map /config from inside the container to be accessible from /mnt/app/config on the host's filesystem.
-v /config - local path for readmesync config file-p 80 - HTTP port for API webserver-e PUID - for UserID, see below for explanation-e PGID - for GroupID, see below for explanation-e TZ - for setting timezone information, eg Australia/MelbourneIt is based on wolfi, or alpine linux for the alpine tag, with s6 overlay, for shell access whilst the container is running do docker exec -it readmesync /bin/bash.
Sometimes when using data volumes (-v flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user PUID and group PGID. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work".
In this instance PUID=1001 and PGID=1001. To find yours use id user as below:
$ id <dockeruser>
uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup)
The container uses a single volume mounted at '/config'. This volume stores the configuration file 'readmesync.json'.
config
|-- readmesync.json
The readmesync.json is copied to the /config volume when first run, readable only by the container's user. It has two mandatory parameters and an optional port.
dockerhub_username: String (Required) | Your DockerHub username
dockerhub_password: String (Required) | Your DockerHub password, or a personal access token
port: Number (Optional) | The port the API listens on, 80 by default
Either the account password or a personal access token with read and write scope works. A token is recommended, as it can be scoped and revoked on its own, and it is required when the account has two-factor authentication or its organisation enforces SSO. Create one under Account settings, Personal access tokens.
API - GET command
You can provide a GitHub branch if you want to sync a README.md from a branch other than master, if none is provided master is assumed. Any path is accepted.
http://<ip_address>:<port>/description/update?github_repo=<github_repo>&dockerhub_repo=<dockerhub_repo>
http://<ip_address>:<port>/description/update?github_repo=<github_repo>&github_branch=<github_branch>&dockerhub_repo=<dockerhub_repo>
The response is 200 OK once Docker Hub has stored the README, 400 for a missing or malformed field or a repository or branch with no README.md, and 502 when Docker Hub refuses the login or the update, with Docker Hub's own message in the body.
Linting runs locally through lefthook. Install the hooks once per clone:
lefthook install
pre-commit runs golangci-lint and go test, editorconfig-checker, hadolint, jq, shellcheck, typos and yamllint over the staged files, and commit-msg enforces Conventional Commits. Run everything on demand with:
lefthook run pre-commit --all-files
readmesync uses the go standard library alone. Renovate bumps the golang build image in the Dockerfile and the go version in go.mod. The base images are followed at antilax3/wolfi:latest and antilax3/alpine:latest, so each build picks up their changes without a bump here.
Content type
Image
Digest
sha256:efb0ee8a3…
Size
21.1 MB
Last updated
about 23 hours ago
docker pull antilax3/readme-sync