Created
February 3, 2018 03:52
-
-
Save matthewadams/cfd0ee138f46d206572d3c917a5d0d58 to your computer and use it in GitHub Desktop.
.dockercfgjson Helm template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{- define "dockercfg" -}} | |
{{- $hostname := required "A Docker image registry hostname is required" .Values.image.registry.auth.hostname -}} | |
{{- $username := required "A Docker image registry username is required" .Values.image.registry.auth.username -}} | |
{{- $password := required "A Docker image registry password is required" .Values.image.registry.auth.password -}} | |
{{- $email := required "A Docker image registry email is required" .Values.image.registry.auth.email -}} | |
{{- $auth := printf "%s:%s" $username $password | b64enc -}} | |
{{- $cfg := printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" $hostname $username $password $email $auth -}} | |
{{- $cfg | b64enc -}} | |
{{- end -}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment