Skip to content

Simple CLI tool to generate Docker config.json with registry credentials

License

Notifications You must be signed in to change notification settings

containeroo/dologen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

go install github.com/containeroo/dologen@latest

Local build

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

dologen --username USER --password PASS --server registry.example.com

Output 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 --base64

Print completion scripts generated by the CLI:

source <(dologen completion bash)
source <(dologen completion zsh)

Legacy flag form is also supported:

dologen --completion bash

Release artifacts and Homebrew packaging include completion files generated at build time by GoReleaser.

Print version:

dologen --version

Flags

  -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.

About

Simple CLI tool to generate Docker config.json with registry credentials

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages