From ae632a3dd7cf7727b9798c536838036cebd71908 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Sat, 3 Jan 2026 23:41:13 +0000 Subject: [PATCH] fix: add extra_files to copy source directories into Docker build context GoReleaser creates a temporary build context with only binaries, but our Dockerfiles are multi-stage builds that need the full source code to compile. Added extra_files to copy necessary directories. Files copied per image: - gohoarder-server: go.mod, go.sum, cmd, pkg, internal, config - gohoarder-scanner: go.mod, go.sum, cmd, pkg, internal, config - gohoarder-migrate: go.mod, go.sum, cmd, pkg, internal, migrations - gohoarder-frontend: frontend/ directory (Node.js source) - gohoarder-gateway: no extra files needed (static config) This fixes the build context error: "Seems like you tried to copy a file that is not available in the build context." --- .goreleaser.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 9b60203..94688f8 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -146,6 +146,13 @@ dockers_v2: - "--label=org.opencontainers.image.version={{ .Version }}" - "--label=org.opencontainers.image.created={{ .Date }}" - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + extra_files: + - go.mod + - go.sum + - cmd + - pkg + - internal + - config.yaml.example # 2. Website - Frontend Dashboard - id: gohoarder-frontend @@ -167,6 +174,8 @@ dockers_v2: - "--label=org.opencontainers.image.version={{ .Version }}" - "--label=org.opencontainers.image.created={{ .Date }}" - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + extra_files: + - frontend # 3. Scanning Engine - Background scanner worker - id: gohoarder-scanner @@ -192,6 +201,13 @@ dockers_v2: - "--label=org.opencontainers.image.version={{ .Version }}" - "--label=org.opencontainers.image.created={{ .Date }}" - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + extra_files: + - go.mod + - go.sum + - cmd + - pkg + - internal + - config.yaml.example # 4. Gateway - Nginx reverse proxy for unified deployment - id: gohoarder-gateway @@ -238,6 +254,13 @@ dockers_v2: - "--label=org.opencontainers.image.version={{ .Version }}" - "--label=org.opencontainers.image.created={{ .Date }}" - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + extra_files: + - go.mod + - go.sum + - cmd + - pkg + - internal + - migrations # Artifact signing with cosign signs: