Skip to content

goreleaser fast docker image deployment to GitHub

Anton W edited this page Apr 4, 2026 · 1 revision

Welcome to the immich-upload-optimizer wiki!

Fast docker image deployment, change goreleaser file to:

version: 2

before:
  hooks:
    - go generate ./...
    - go mod tidy

builds:
  - env:
      - CGO_ENABLED=0
    goos:
      - darwin
      - linux
    goarch:
      - amd64
    ldflags:
      - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}}

dockers:
  - goos: linux
    goarch: amd64
    image_templates:
      - "ghcr.io/timaschew/{{.ProjectName}}:{{ .Tag }}"
      - "ghcr.io/timaschew/{{.ProjectName}}:latest"
    dockerfile: "Dockerfile.goreleaser"
    use: buildx
    build_flag_templates:
      - "--pull"
      - "--platform=linux/amd64"
      - "--label=org.opencontainers.image.created={{.Date}}"
      - "--label=org.opencontainers.image.title={{.ProjectName}}"
      - "--label=org.opencontainers.image.revision={{.FullCommit}}"
      - "--label=org.opencontainers.image.version={{.Version}}"
      - "--label=org.opencontainers.image.url=https://github.com/timaschew/{{ .ProjectName }}"
      - "--label=org.opencontainers.image.source=https://github.com/timaschew/{{ .ProjectName }}"
    extra_files:
      - config
      - LICENSE

archives:
  - files:
      - LICENSE*
      - README*
      - CHANGELOG*
    formats: tar.gz
    name_template: >-
      {{ .ProjectName }}_
      {{- title .Os }}_
      x86_64
    format_overrides:
      - goos: windows
        formats: zip

checksum:
  name_template: "checksums.txt"

snapshot:
  version_template: "{{ incpatch .Version }}-next"

changelog:
  sort: asc
  filters:
    exclude:
      - "^docs:"
      - "^test:"
      - "^chore:"
      - "^ci:"

# yaml-language-server: $schema=https://goreleaser.com/static/schema.json

Clone this wiki locally