diff --git a/datagen/.goreleaser.yml b/datagen/.goreleaser.yml index 9ef629e6..243bd257 100644 --- a/datagen/.goreleaser.yml +++ b/datagen/.goreleaser.yml @@ -21,18 +21,21 @@ builds: - "-trimpath" ldflags: - "-s -w" -dockers: - - ids: +dockers_v2: + - id: datagen + ids: - oxynote-datagen - goos: linux - goarch: amd64 - image_templates: - - "ghcr.io/oxynote/datagen:{{ .Version }}" - - "ghcr.io/oxynote/datagen:latest" dockerfile: ./Dockerfile.dev - build_flag_templates: - - "--pull" - - "--platform=linux/amd64" + images: + - ghcr.io/oxynote/datagen + tags: + - "{{ .Version }}" + - latest + platforms: + - linux/amd64 + sbom: false + flags: + - "--provenance=false" checksum: disable: true archives: diff --git a/datagen/Dockerfile.dev b/datagen/Dockerfile.dev index d7e15048..de0ae2c8 100644 --- a/datagen/Dockerfile.dev +++ b/datagen/Dockerfile.dev @@ -1,3 +1,4 @@ FROM gcr.io/distroless/static-debian10:nonroot -COPY oxynote-datagen / +ARG TARGETPLATFORM +COPY ${TARGETPLATFORM}/oxynote-datagen /oxynote-datagen ENTRYPOINT ["/oxynote-datagen"] diff --git a/datagen/Makefile b/datagen/Makefile index 4c7f684f..0e2d34ae 100644 --- a/datagen/Makefile +++ b/datagen/Makefile @@ -1,3 +1,6 @@ # Build the Docker image +# dockers_v2 snapshot builds load into the local daemon with an arch suffix; +# retag so the dev compose stack can reference a stable :dev tag. build: goreleaser release --snapshot --clean + docker tag ghcr.io/oxynote/datagen:dev-amd64 ghcr.io/oxynote/datagen:dev diff --git a/server/core/.goreleaser.yml b/server/core/.goreleaser.yml index 8baf4eff..5dab31e5 100644 --- a/server/core/.goreleaser.yml +++ b/server/core/.goreleaser.yml @@ -46,31 +46,39 @@ builds: - "-X github.com/oxynote/oxynote/server/core/internal/buildinfo._version={{ .Version }}" - "-X github.com/oxynote/oxynote/server/core/internal/buildinfo._commit={{ .ShortCommit }}" - "-X github.com/oxynote/oxynote/server/core/internal/buildinfo._timestampString={{ .CommitDate }}" -dockers: - - ids: +dockers_v2: + - id: core + ids: - core - goos: linux - goarch: amd64 - image_templates: - - "ghcr.io/oxynote/core:{{ .Version }}" - - "ghcr.io/oxynote/core:latest" dockerfile: ./Dockerfile.dev - build_flag_templates: - - "--pull" - - "--platform=linux/amd64" - - "--build-arg=BINARY={{ .ProjectName }}-core" - - ids: + images: + - ghcr.io/oxynote/core + tags: + - "{{ .Version }}" + - latest + platforms: + - linux/amd64 + build_args: + BINARY: oxynote-core + sbom: false + flags: + - "--provenance=false" + - id: connector + ids: - connector - goos: linux - goarch: amd64 - image_templates: - - "ghcr.io/oxynote/connector:{{ .Version }}" - - "ghcr.io/oxynote/connector:latest" dockerfile: ./Dockerfile.dev - build_flag_templates: - - "--pull" - - "--platform=linux/amd64" - - "--build-arg=BINARY={{ .ProjectName }}-connector" + images: + - ghcr.io/oxynote/connector + tags: + - "{{ .Version }}" + - latest + platforms: + - linux/amd64 + build_args: + BINARY: oxynote-connector + sbom: false + flags: + - "--provenance=false" checksum: disable: true archives: diff --git a/server/core/Dockerfile.dev b/server/core/Dockerfile.dev index e5724428..ea092d41 100644 --- a/server/core/Dockerfile.dev +++ b/server/core/Dockerfile.dev @@ -1,5 +1,6 @@ FROM gcr.io/distroless/static-debian10:nonroot +ARG TARGETPLATFORM ARG BINARY -COPY ${BINARY} /app +COPY ${TARGETPLATFORM}/${BINARY} /app ENTRYPOINT ["/app"] EXPOSE 8080 diff --git a/server/core/Makefile b/server/core/Makefile index 4c7f684f..1df883a4 100644 --- a/server/core/Makefile +++ b/server/core/Makefile @@ -1,3 +1,7 @@ # Build the Docker image +# dockers_v2 snapshot builds load into the local daemon with an arch suffix; +# retag so the dev compose stack can reference a stable :dev tag. build: goreleaser release --snapshot --clean + docker tag ghcr.io/oxynote/core:dev-amd64 ghcr.io/oxynote/core:dev + docker tag ghcr.io/oxynote/connector:dev-amd64 ghcr.io/oxynote/connector:dev