Login to ecr and push build image to it with the help of gorelaeser

216 Views Asked by At

I have created make release process with the help of gorelaeser . But in my case I need to build and push image to ECR. Currently before building image I'm login to ecr and then building image but don't know how to push image via gorelaeser.

.goreleaser.yml

dockers:

goos: linux
goarch: amd64
image_templates:
- "myuser/myimage:latest"
- "myuser/myimage:{{ .Tag }}"
- "myuser/myimage:{{ .Tag }}-{{ .Env.GO_VERSION }}"
- "myuser/myimage:v{{ .Major }}"
- "gcr.io/myuser/myimage:latest"
skip_push: false
dockerfile: Dockerfile
use: docker
build_flag_templates:
- "--build-arg=FOO={{.Env.Bar}}"
- "--platform=linux/arm64
push_flags:
- --tls-verify=false

Tried changing skip_push value to true also

1

There are 1 best solutions below

0
On

GoReleaser will push the images automatically in the end of the process if you run goreleaser release, provided that docker is authorized to do so.

GoReleaser does not push if you're running goreleaser build or goreleaser release --snapshot though, so maybe you're doing one of these?