Skip to content

Simple bash script to generate a base64 encoded .dockerconfigjson for a kubernetes docker registry secret.

License

Notifications You must be signed in to change notification settings

psaia/gen-dockercfg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gen-dockercfg

Simple bash script to generate a base64 encoded dockercfg for a kubernetes docker registry secret. This is useful for when you need to create the dockercfg code manually instead of running: kubectl create secret docker-registry mydockercfg \ --docker-server "your-server" .... Creating a values.yaml for helm would be a good use case.

Usage

$ gen-dockercfg "your-server" "the-username" "the-password" "the-email"

# => eyJodHRwczovL215LXNlcnZlci5jb20iOnsidXNlcm5hbWUiOiJteS11c2VybmFtZSIsInBhc3N3b3JkIjoibXktcGFzc3dvcmQiLCJlbWFpbCI6Im15QGVtYWlsLmNvbSIsImF1dGgiOiJiWGt0ZFhObGNtNWhiV1U2YlhrdGNHRnpjM2R2Y21RSyJ9fQo=

You could now use that value for the secret. E.g.

...
data:
  .dockerconfigjson: eyJod...
...

Quick Install/Update

curl -L https://raw.githubusercontent.com/psaia/gen-dockercfg/master/gen-dockercfg >/usr/local/bin/gen-dockercfg \
  && chmod +x /usr/local/bin/gen-dockercfg

About

Simple bash script to generate a base64 encoded .dockerconfigjson for a kubernetes docker registry secret.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages