https://github.com/containeroo/dologen
Simple CLI tool to generate Docker config.json with registry credentials
https://github.com/containeroo/dologen
cli credentials docker docker-registry golang helper kubernetes
Last synced: 5 months ago
JSON representation
Simple CLI tool to generate Docker config.json with registry credentials
- Host: GitHub
- URL: https://github.com/containeroo/dologen
- Owner: containeroo
- License: mit
- Created: 2021-07-06T11:10:42.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-08-31T21:01:08.000Z (10 months ago)
- Last Synced: 2025-08-31T23:27:15.317Z (10 months ago)
- Topics: cli, credentials, docker, docker-registry, golang, helper, kubernetes
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dologen
`dologen` generates a Docker `config.json` payload with registry credentials. It is useful for Kubernetes image pull secrets and CI jobs.
## Install
### From source
```bash
go install github.com/containeroo/dologen@latest
```
### Local build
```bash
go build -o dologen .
```
## Auth and setup
`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.
## Usage
```bash
dologen --username USER --password PASS --server registry.example.com
```
Output is JSON on stdout:
```json
{"auths":{"registry.example.com":{"username":"USER","password":"PASS","auth":""}}}
```
Base64 encode the entire JSON payload:
```bash
dologen --username USER --password-file /path/to/password.txt --server registry.example.com --base64
```
Print completion scripts generated by the CLI:
```bash
source <(dologen completion bash)
source <(dologen completion zsh)
```
Legacy flag form is also supported:
```bash
dologen --completion bash
```
Release artifacts and Homebrew packaging include completion files generated at build time by GoReleaser.
Print version:
```bash
dologen --version
```
## Flags
```text
-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
```
## Security caveats
- Output includes registry credentials in cleartext JSON unless `--base64` is 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-file` with owner-only permissions (`chmod 600`), and avoid shared/world-readable files.
- Redirect output carefully and avoid committing generated secret material.