1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00

docs: env support for docker tag_template

Update docs for tag_template.
This commit is contained in:
Frank Schroeder 2017-12-06 00:13:16 +01:00 committed by Carlos Alexandro Becker
parent 25e1cddc1b
commit c929320782

View File

@ -51,7 +51,7 @@ dockers:
# Path to the Dockerfile (from the project root).
dockerfile: Dockerfile
# Template of the docker tag. Defaults to `{{ .Version }}`. Other allowed
# fields are `.Tag`.
# fields are `.Tag` and `.Env.VARIABLE_NAME`.
tag_template: "{{ .Tag }}"
# Also tag and push myuser/myimage:latest.
latest: true
@ -64,3 +64,20 @@ dockers:
These settings should allow you to generate multiple Docker images,
for example, using multiple `FROM` statements,
as well as generate one image for each binary in your project.
## Passing environment variables to tag_template
You can do that by using `{{ .Env.VARIABLE_NAME }}` in the template, for
example:
```yaml
dockers:
-
tag_template: "{{ .Tag }}-{{ .Env.GOVERSION_NR }}"
```
Then you can run:
```console
GOVERSION_NR=$(go version | awk '{print $3}') goreleaser
```