dologen generates a Docker config.json payload with registry credentials. It is useful for Kubernetes image pull secrets and CI jobs.
go install github.com/containeroo/dologen@latestgo build -o dologen .dologen requires:
--username(-u)--server(-s)- either
--password(-p) or--password-file(-f)
If both --password and --password-file are provided, --password-file is used.
dologen --username USER --password PASS --server registry.example.comOutput is JSON on stdout:
{"auths":{"registry.example.com":{"username":"USER","password":"PASS","auth":"<base64 USER:PASS>"}}}Base64 encode the entire JSON payload:
dologen --username USER --password-file /path/to/password.txt --server registry.example.com --base64Print completion scripts generated by the CLI:
source <(dologen completion bash)
source <(dologen completion zsh)Legacy flag form is also supported:
dologen --completion bashRelease artifacts and Homebrew packaging include completion files generated at build time by GoReleaser.
Print version:
dologen --version -b, --base64 output result base64 encoded
--completion string print shell completion script: bash|zsh
-f, --password-file string password file for docker registry
-p, --password string password for docker registry
-s, --server string docker registry server
-u, --username string username for docker registry
-v, --version Print the current version and exit
- Output includes registry credentials in cleartext JSON unless
--base64is used (base64 is encoding, not encryption). - Avoid passing secrets directly on the command line when possible, because process arguments may be visible to other users or shell history.
- Prefer
--password-filewith owner-only permissions (chmod 600), and avoid shared/world-readable files. - Redirect output carefully and avoid committing generated secret material.