how to build images using Gorelease when it does not have docker installed, do i have to do a docker in docker or are there other ways like expose a service?
func (m *Nocdkp) Release(ctx context.Context, context *dagger.Directory, token *dagger.Secret) (string, error) {
secret, err := token.Plaintext(ctx)
if err != nil {
return "", err
}
return dag.Goreleaser().
WithGoCache().
WithEnvVar("GITHUB_TOKEN", secret, true).
WithSource(context).
Release(ctx)
}
project_name: NocDkp
version: 2
env:
- CGO_ENABLED=0
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- binary: bot
id: bot
main: ./app/bot/cmd
goos:
- linux
- windows
- darwin
archives:
- formats: [tar.gz]
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
formats: [zip]
dockers:
# bot
- dockerfile: app/bot/goreleaser.Dockerfile
ids:
- bot
image_templates:
- "ghcr.io/jensholdgaard/nocdkp/bot:{{ .Tag }}-amd64"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- dockerfile: app/bot/goreleaser.Dockerfile
ids:
- bot
image_templates:
- "ghcr.io/jensholdgaard/nocdkp/bot:{{ .Tag }}-arm64"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
docker_manifests:
# bot
- name_template: "ghcr.io/jensholdgaard/nocdkp/bot:{{ .Tag }}"
image_templates:
- "ghcr.io/jensholdgaard/nocdkp/bot:{{ .Tag }}-amd64"
- "ghcr.io/jensholdgaard/nocdkp/bot:{{ .Tag }}-arm64"
- name_template: "ghcr.io/jensholdgaard/nocdkp/bot:latest"
image_templates:
- "ghcr.io/jensholdgaard/nocdkp/bot:{{ .Tag }}-amd64"
- "ghcr.io/jensholdgaard/nocdkp/bot:{{ .Tag }}-arm64"
release:
footer: >-
---
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).