From edbeda79cc5f587ba1fa42d422cf288b7c9a1a03 Mon Sep 17 00:00:00 2001 From: albttx Date: Thu, 23 May 2024 15:30:18 +0100 Subject: [PATCH 01/13] chore(docker): fix binary path for dockerfiles --- Dockerfile.gno.release | 9 ++++++--- Dockerfile.gnokey.release | 6 +++--- Dockerfile.gnoland.release | 11 +++++++---- Dockerfile.gnoweb.release | 6 +++--- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Dockerfile.gno.release b/Dockerfile.gno.release index 874d427661f..a7f03dcb401 100644 --- a/Dockerfile.gno.release +++ b/Dockerfile.gno.release @@ -1,11 +1,14 @@ FROM busybox -COPY ./gno /gno +COPY ./gno /usr/bin/gno COPY ./examples /gnoroot/examples/ COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/ COPY ./gnovm/tests/stdlibs /gnoroot/gnovm/tests/stdlibs/ ENV GNOROOT="/gnoroot/" -ENTRYPOINT [ "/gno" ] -CMD [ "" ] \ No newline at end of file +WORKDIR /gnoroot/ + +ENTRYPOINT [ "/usr/bin/gno" ] + +CMD [ "" ] diff --git a/Dockerfile.gnokey.release b/Dockerfile.gnokey.release index 4261f9272d6..d4fa7a1cf66 100644 --- a/Dockerfile.gnokey.release +++ b/Dockerfile.gnokey.release @@ -1,6 +1,6 @@ FROM busybox -COPY . / +COPY ./gnokey /usr/bin/gnokey -ENTRYPOINT [ "/gnokey" ] -CMD [ "" ] \ No newline at end of file +ENTRYPOINT [ "/usr/bin/gnokey" ] +CMD [ "" ] diff --git a/Dockerfile.gnoland.release b/Dockerfile.gnoland.release index f8bd321f67f..2918528cdcb 100644 --- a/Dockerfile.gnoland.release +++ b/Dockerfile.gnoland.release @@ -1,6 +1,6 @@ FROM busybox -COPY ./gnoland /gnoland +COPY ./gnoland /usr/bin/gnoland COPY ./examples /gnoroot/examples/ COPY ./gnovm/stdlibs /gnoroot/gnovm/stdlibs/ COPY ./gno.land/genesis/genesis_balances.txt /gnoroot/gno.land/genesis/genesis_balances.txt @@ -8,6 +8,9 @@ COPY ./gno.land/genesis/genesis_txs.jsonl /gnoroot/gno.land/genesis/genesis_txs. ENV GNOROOT="/gnoroot/" -EXPOSE 26657 36657 -ENTRYPOINT [ "/gnoland" ] -CMD [ "" ] \ No newline at end of file +WORKDIR /gnoroot/ + +EXPOSE 26657 26657 + +ENTRYPOINT [ "/usr/bin/gnoland" ] +CMD [ "" ] diff --git a/Dockerfile.gnoweb.release b/Dockerfile.gnoweb.release index 9bdfd8ddce2..28425eb128d 100644 --- a/Dockerfile.gnoweb.release +++ b/Dockerfile.gnoweb.release @@ -1,7 +1,7 @@ FROM busybox -COPY . / +COPY ./gnoweb /usr/bin/gnoweb EXPOSE 8888 -ENTRYPOINT [ "/gnoweb" ] -CMD [ "" ] \ No newline at end of file +ENTRYPOINT [ "/usr/bin/gnoweb" ] +CMD [ "" ] From dea3de26484c9e952d52297f0bcdc2abf792e591 Mon Sep 17 00:00:00 2001 From: albttx Date: Sun, 26 May 2024 09:18:06 +0100 Subject: [PATCH 02/13] chore: use alpine docker images --- .dockerignore | 1 + .github/goreleaser.yaml | 75 ++++++++++++++++++++++++----------------- Dockerfile | 60 +++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+), 31 deletions(-) create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore index a45b7bafa98..60ac2555859 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ +.git .dockerignore build/ Dockerfile diff --git a/.github/goreleaser.yaml b/.github/goreleaser.yaml index d82b31ea9fb..a6eb7577ac8 100644 --- a/.github/goreleaser.yaml +++ b/.github/goreleaser.yaml @@ -69,7 +69,7 @@ gomod: proxy: true archives: - # https://goreleaser.com/customization/archive/ + # https://goreleaser.com/customization/archive/ - files: # Standard Release Files - LICENSE.md @@ -79,28 +79,29 @@ signs: - cmd: cosign env: - COSIGN_EXPERIMENTAL=1 - certificate: '${artifact}.pem' + certificate: "${artifact}.pem" args: - sign-blob - - '--output-certificate=${certificate}' - - '--output-signature=${signature}' - - '${artifact}' + - "--output-certificate=${certificate}" + - "--output-signature=${signature}" + - "${artifact}" - "--yes" # needed on cosign 2.0.0+ artifacts: checksum output: true dockers: # https://goreleaser.com/customization/docker/ - - # gno + + # gno - use: buildx - dockerfile: Dockerfile.gno.release + dockerfile: Dockerfile goos: linux goarch: amd64 image_templates: - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-amd64" - "ghcr.io/gnolang/{{ .ProjectName }}:latest-amd64" build_flag_templates: + - "--target=gno-alpine" - "--platform=linux/amd64" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}" @@ -113,13 +114,14 @@ dockers: - gnovm/stdlibs - gnovm/tests/stdlibs - use: buildx - dockerfile: Dockerfile.gno.release + dockerfile: Dockerfile goos: linux goarch: arm64 image_templates: - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-arm64v8" - "ghcr.io/gnolang/{{ .ProjectName }}:latest-arm64v8" build_flag_templates: + - "--target=gno-alpine" - "--platform=linux/arm64/v8" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}" @@ -132,7 +134,6 @@ dockers: - gnovm/stdlibs - gnovm/tests/stdlibs - use: buildx - dockerfile: Dockerfile.gno.release goos: linux goarch: arm goarm: 6 @@ -140,6 +141,7 @@ dockers: - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv6" - "ghcr.io/gnolang/{{ .ProjectName }}:latest-armv6" build_flag_templates: + - "--target=gno-alpine" - "--platform=linux/arm/v6" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}" @@ -152,7 +154,7 @@ dockers: - gnovm/stdlibs - gnovm/tests/stdlibs - use: buildx - dockerfile: Dockerfile.gno.release + dockerfile: Dockerfile goos: linux goarch: arm goarm: 7 @@ -160,6 +162,7 @@ dockers: - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv7" - "ghcr.io/gnolang/{{ .ProjectName }}:latest-armv7" build_flag_templates: + - "--target=gno-alpine" - "--platform=linux/arm/v7" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}" @@ -174,13 +177,14 @@ dockers: # gnoland - use: buildx - dockerfile: Dockerfile.gnoland.release + dockerfile: Dockerfile goos: linux goarch: amd64 image_templates: - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-amd64" - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-amd64" build_flag_templates: + - "--target=gnoland-alpine" - "--platform=linux/amd64" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" @@ -194,7 +198,7 @@ dockers: - examples - gnovm/stdlibs - use: buildx - dockerfile: Dockerfile.gnoland.release + dockerfile: Dockerfile goos: linux goarch: arm64 image_templates: @@ -214,7 +218,7 @@ dockers: - examples - gnovm/stdlibs - use: buildx - dockerfile: Dockerfile.gnoland.release + dockerfile: Dockerfile goos: linux goarch: arm goarm: 6 @@ -222,6 +226,7 @@ dockers: - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-armv6" - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-armv6" build_flag_templates: + - "--target=gnoland-alpine" - "--platform=linux/arm/v6" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" @@ -235,7 +240,7 @@ dockers: - examples - gnovm/stdlibs - use: buildx - dockerfile: Dockerfile.gnoland.release + dockerfile: Dockerfile goos: linux goarch: arm goarm: 7 @@ -243,6 +248,7 @@ dockers: - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-armv7" - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-armv7" build_flag_templates: + - "--target=gnoland-alpine" - "--platform=linux/arm/v7" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" @@ -257,7 +263,7 @@ dockers: - gnovm/stdlibs # gnokey - use: buildx - dockerfile: Dockerfile.gnokey.release + dockerfile: Dockerfile goos: linux goarch: amd64 image_templates: @@ -272,13 +278,14 @@ dockers: ids: - gnokey - use: buildx - dockerfile: Dockerfile.gnokey.release + dockerfile: Dockerfile goos: linux goarch: arm64 image_templates: - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-arm64v8" - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-arm64v8" build_flag_templates: + - "--target=gnokey-alpine" - "--platform=linux/arm64/v8" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" @@ -287,7 +294,7 @@ dockers: ids: - gnokey - use: buildx - dockerfile: Dockerfile.gnokey.release + dockerfile: Dockerfile goos: linux goarch: arm goarm: 6 @@ -295,6 +302,7 @@ dockers: - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-armv6" - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-armv6" build_flag_templates: + - "--target=gnokey-alpine" - "--platform=linux/arm/v6" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" @@ -303,7 +311,7 @@ dockers: ids: - gnokey - use: buildx - dockerfile: Dockerfile.gnokey.release + dockerfile: Dockerfile goos: linux goarch: arm goarm: 7 @@ -311,6 +319,7 @@ dockers: - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-armv7" - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-armv7" build_flag_templates: + - "--target=gnokey-alpine" - "--platform=linux/arm/v7" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" @@ -318,16 +327,17 @@ dockers: - "--label=org.opencontainers.image.version={{.Version}}" ids: - gnokey - + # gnoweb - use: buildx - dockerfile: Dockerfile.gnoweb.release + dockerfile: Dockerfile goos: linux goarch: amd64 image_templates: - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-amd64" - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-amd64" build_flag_templates: + - "--target=gnoweb-alpine" - "--platform=linux/amd64" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" @@ -336,13 +346,14 @@ dockers: ids: - gnoweb - use: buildx - dockerfile: Dockerfile.gnoweb.release + dockerfile: Dockerfile goos: linux goarch: arm64 image_templates: - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-arm64v8" - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-arm64v8" build_flag_templates: + - "--target=gnoweb-alpine" - "--platform=linux/arm64/v8" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" @@ -351,7 +362,7 @@ dockers: ids: - gnoweb - use: buildx - dockerfile: Dockerfile.gnoweb.release + dockerfile: Dockerfile goos: linux goarch: arm goarm: 6 @@ -359,6 +370,7 @@ dockers: - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-armv6" - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-armv6" build_flag_templates: + - "--target=gnoweb-alpine" - "--platform=linux/arm/v6" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" @@ -367,7 +379,7 @@ dockers: ids: - gnoweb - use: buildx - dockerfile: Dockerfile.gnoweb.release + dockerfile: Dockerfile goos: linux goarch: arm goarm: 7 @@ -375,6 +387,7 @@ dockers: - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-armv7" - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-armv7" build_flag_templates: + - "--target=gnoweb-alpine" - "--platform=linux/arm/v7" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" @@ -399,7 +412,7 @@ docker_manifests: - ghcr.io/gnolang/{{ .ProjectName }}:latest-arm64v8 - ghcr.io/gnolang/{{ .ProjectName }}:latest-armv6 - ghcr.io/gnolang/{{ .ProjectName }}:latest-armv7 - + # gnoland - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }} image_templates: @@ -413,7 +426,7 @@ docker_manifests: - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-arm64v8 - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-armv6 - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-armv7 - + # gnokey - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }} image_templates: @@ -427,7 +440,7 @@ docker_manifests: - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-arm64v8 - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-armv6 - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-armv7 - + # gnoweb - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }} image_templates: @@ -449,12 +462,12 @@ docker_signs: artifacts: images output: true args: - - 'sign' - - '${artifact}' + - "sign" + - "${artifact}" - "--yes" # needed on cosign 2.0.0+ checksum: - name_template: 'checksums.txt' + name_template: "checksums.txt" changelog: sort: asc @@ -482,4 +495,4 @@ release: nightly: tag_name: nightly publish_release: true - keep_single_release: true \ No newline at end of file + keep_single_release: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000..2b54288c29a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,60 @@ +# build gno +FROM golang:1.22-alpine AS build-gno +RUN go env -w GOMODCACHE=/root/.cache/go-build + +ENV GNOROOT="/gnoroot" +RUN mkdir -p $GNOROOT +WORKDIR /gnoroot + +ADD go.mod go.sum . +RUN --mount=type=cache,target=/root/.cache/go-build go mod download +COPY . ./ +RUN --mount=type=cache,target=/root/.cache/go-build go install ./gno.land/cmd/gnoland +RUN --mount=type=cache,target=/root/.cache/go-build go install ./gno.land/cmd/gnokey +RUN --mount=type=cache,target=/root/.cache/go-build go install ./gno.land/cmd/gnoweb +RUN --mount=type=cache,target=/root/.cache/go-build go install ./gnovm/cmd/gno +COPY . /gnoroot + +# runtime-base +FROM alpine:3.17 AS runtime-base +RUN apk add ca-certificates +ENV GNOROOT="/gnoroot" +RUN mkdir -p $GNOROOT +WORKDIR /gnoroot + +# alpine images +FROM runtime-base AS gno-alpine +COPY --from=build-gno /usr/local/go/bin/gno /usr/bin/ +ENTRYPOINT ["/usr/bin/gno"] + +FROM runtime-base AS gnoland-alpine +COPY --from=build-gno /usr/local/go/bin/gnoland /usr/bin/ +EXPOSE 26657 26657 +ENTRYPOINT ["/usr/bin/gnoland"] + +FROM runtime-base AS gnokey-alpine +COPY --from=build-gno /usr/local/go/bin/gnokey /usr/bin/ +ENTRYPOINT ["/usr/bin/gnokey"] + +FROM runtime-base AS gnofaucet-alpine +COPY --from=build-faucet /usr/local/go/bin/gnofaucet /usr/bin/ +EXPOSE 5050 +ENTRYPOINT ["/usr/bin/gnofaucet"] + +FROM runtime-base AS gnoweb-alpine +COPY --from=build-gno /usr/local/go/bin/gnoweb /usr/bin/ +COPY --from=build-gno /gnoroot/gno.land/cmd/gnoweb /gnoroot/src/gnoweb +EXPOSE 8888 +ENTRYPOINT ["/usr/bin/gnoweb"] + +# all, contains everything. +FROM runtime-base AS all +COPY --from=build-gno /usr/local/go/bin/gnoland /usr/bin/ +COPY --from=build-gno /usr/local/go/bin/gnokey /usr/bin/ +COPY --from=build-gno /usr/local/go/bin/gno /usr/bin/ +COPY --from=build-gno /usr/local/go/bin/gnoweb /usr/bin/ +# COPY --from=build-gno /gnoroot/gno.land/cmd/gnoweb /gnoroot/src/gnoweb + +COPY --from=build-gno /gnoroot /gnoroot +# gofmt is required by `gnokey maketx addpkg` +COPY --from=build-gno /usr/local/go/bin/gofmt /usr/bin From 5f4495d499021df957752b84777e7451a92be717 Mon Sep 17 00:00:00 2001 From: albttx Date: Sun, 26 May 2024 10:16:30 +0100 Subject: [PATCH 03/13] chore: remove goreleaser to build docker images --- .github/goreleaser-nightly.yaml | 378 +------------------------------- .github/goreleaser.yaml | 378 -------------------------------- .github/workflows/docker.yml | 133 +++++++++++ 3 files changed, 140 insertions(+), 749 deletions(-) create mode 100644 .github/workflows/docker.yml diff --git a/.github/goreleaser-nightly.yaml b/.github/goreleaser-nightly.yaml index f879b37657d..a5eba436280 100644 --- a/.github/goreleaser-nightly.yaml +++ b/.github/goreleaser-nightly.yaml @@ -69,7 +69,7 @@ gomod: proxy: true archives: - # https://goreleaser.com/customization/archive/ + # https://goreleaser.com/customization/archive/ - files: # Standard Release Files - LICENSE.md @@ -79,382 +79,18 @@ signs: - cmd: cosign env: - COSIGN_EXPERIMENTAL=1 - certificate: '${artifact}.pem' + certificate: "${artifact}.pem" args: - sign-blob - - '--output-certificate=${certificate}' - - '--output-signature=${signature}' - - '${artifact}' + - "--output-certificate=${certificate}" + - "--output-signature=${signature}" + - "${artifact}" - "--yes" # needed on cosign 2.0.0+ artifacts: checksum output: true -dockers: - # https://goreleaser.com/customization/docker/ - - # gno - - use: buildx - dockerfile: Dockerfile.gno.release - goos: linux - goarch: amd64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-amd64" - - "ghcr.io/gnolang/{{ .ProjectName }}:nightly-amd64" - build_flag_templates: - - "--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}}" - ids: - - gno - extra_files: - - examples - - gnovm/stdlibs - - gnovm/tests/stdlibs - - use: buildx - dockerfile: Dockerfile.gno.release - goos: linux - goarch: arm64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-arm64v8" - - "ghcr.io/gnolang/{{ .ProjectName }}:nightly-arm64v8" - build_flag_templates: - - "--platform=linux/arm64/v8" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gno - extra_files: - - examples - - gnovm/stdlibs - - gnovm/tests/stdlibs - - use: buildx - dockerfile: Dockerfile.gno.release - goos: linux - goarch: arm - goarm: 6 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv6" - - "ghcr.io/gnolang/{{ .ProjectName }}:nightly-armv6" - build_flag_templates: - - "--platform=linux/arm/v6" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gno - extra_files: - - examples - - gnovm/stdlibs - - gnovm/tests/stdlibs - - use: buildx - dockerfile: Dockerfile.gno.release - goos: linux - goarch: arm - goarm: 7 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv7" - - "ghcr.io/gnolang/{{ .ProjectName }}:nightly-armv7" - build_flag_templates: - - "--platform=linux/arm/v7" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gno - extra_files: - - examples - - gnovm/stdlibs - - gnovm/tests/stdlibs - - # gnoland - - use: buildx - dockerfile: Dockerfile.gnoland.release - goos: linux - goarch: amd64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-amd64" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:nightly-amd64" - build_flag_templates: - - "--platform=linux/amd64" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoland - extra_files: - - gno.land/genesis/genesis_balances.txt - - gno.land/genesis/genesis_txs.jsonl - - examples - - gnovm/stdlibs - - use: buildx - dockerfile: Dockerfile.gnoland.release - goos: linux - goarch: arm64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-arm64v8" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:nightly-arm64v8" - build_flag_templates: - - "--platform=linux/arm64/v8" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoland - extra_files: - - gno.land/genesis/genesis_balances.txt - - gno.land/genesis/genesis_txs.jsonl - - examples - - gnovm/stdlibs - - use: buildx - dockerfile: Dockerfile.gnoland.release - goos: linux - goarch: arm - goarm: 6 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-armv6" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:nightly-armv6" - build_flag_templates: - - "--platform=linux/arm/v6" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoland - extra_files: - - gno.land/genesis/genesis_balances.txt - - gno.land/genesis/genesis_txs.jsonl - - examples - - gnovm/stdlibs - - use: buildx - dockerfile: Dockerfile.gnoland.release - goos: linux - goarch: arm - goarm: 7 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-armv7" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:nightly-armv7" - build_flag_templates: - - "--platform=linux/arm/v7" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoland - extra_files: - - gno.land/genesis/genesis_balances.txt - - gno.land/genesis/genesis_txs.jsonl - - examples - - gnovm/stdlibs - # gnokey - - use: buildx - dockerfile: Dockerfile.gnokey.release - goos: linux - goarch: amd64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-amd64" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:nightly-amd64" - build_flag_templates: - - "--platform=linux/amd64" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnokey - - use: buildx - dockerfile: Dockerfile.gnokey.release - goos: linux - goarch: arm64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-arm64v8" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:nightly-arm64v8" - build_flag_templates: - - "--platform=linux/arm64/v8" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnokey - - use: buildx - dockerfile: Dockerfile.gnokey.release - goos: linux - goarch: arm - goarm: 6 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-armv6" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:nightly-armv6" - build_flag_templates: - - "--platform=linux/arm/v6" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnokey - - use: buildx - dockerfile: Dockerfile.gnokey.release - goos: linux - goarch: arm - goarm: 7 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-armv7" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:nightly-armv7" - build_flag_templates: - - "--platform=linux/arm/v7" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnokey - - # gnoweb - - use: buildx - dockerfile: Dockerfile.gnoweb.release - goos: linux - goarch: amd64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-amd64" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:nightly-amd64" - build_flag_templates: - - "--platform=linux/amd64" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoweb - - use: buildx - dockerfile: Dockerfile.gnoweb.release - goos: linux - goarch: arm64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-arm64v8" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:nightly-arm64v8" - build_flag_templates: - - "--platform=linux/arm64/v8" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoweb - - use: buildx - dockerfile: Dockerfile.gnoweb.release - goos: linux - goarch: arm - goarm: 6 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-armv6" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:nightly-armv6" - build_flag_templates: - - "--platform=linux/arm/v6" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoweb - - use: buildx - dockerfile: Dockerfile.gnoweb.release - goos: linux - goarch: arm - goarm: 7 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-armv7" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:nightly-armv7" - build_flag_templates: - - "--platform=linux/arm/v7" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoweb - -docker_manifests: - # https://goreleaser.com/customization/docker_manifest/ - - # gno - - name_template: ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }} - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv7 - - name_template: ghcr.io/gnolang/{{ .ProjectName }}:nightly - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}:nightly-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}:nightly-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}:nightly-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}:nightly-armv7 - - # gnoland - - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }} - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-armv7 - - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnoland:nightly - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:nightly-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:nightly-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:nightly-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:nightly-armv7 - - # gnokey - - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }} - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-armv7 - - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnokey:nightly - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:nightly-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:nightly-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:nightly-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:nightly-armv7 - - # gnoweb - - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }} - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-armv7 - - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:nightly - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:nightly-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:nightly-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:nightly-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:nightly-armv7 - -docker_signs: - - cmd: cosign - env: - - COSIGN_EXPERIMENTAL=1 - artifacts: images - output: true - args: - - 'sign' - - '${artifact}' - - "--yes" # needed on cosign 2.0.0+ - checksum: - name_template: 'checksums.txt' + name_template: "checksums.txt" changelog: sort: asc @@ -482,4 +118,4 @@ release: nightly: tag_name: nightly publish_release: true - keep_single_release: true \ No newline at end of file + keep_single_release: true diff --git a/.github/goreleaser.yaml b/.github/goreleaser.yaml index a6eb7577ac8..2578b82ce65 100644 --- a/.github/goreleaser.yaml +++ b/.github/goreleaser.yaml @@ -88,384 +88,6 @@ signs: - "--yes" # needed on cosign 2.0.0+ artifacts: checksum output: true - -dockers: - # https://goreleaser.com/customization/docker/ - - # gno - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: amd64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-amd64" - - "ghcr.io/gnolang/{{ .ProjectName }}:latest-amd64" - build_flag_templates: - - "--target=gno-alpine" - - "--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}}" - ids: - - gno - extra_files: - - examples - - gnovm/stdlibs - - gnovm/tests/stdlibs - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: arm64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-arm64v8" - - "ghcr.io/gnolang/{{ .ProjectName }}:latest-arm64v8" - build_flag_templates: - - "--target=gno-alpine" - - "--platform=linux/arm64/v8" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gno - extra_files: - - examples - - gnovm/stdlibs - - gnovm/tests/stdlibs - - use: buildx - goos: linux - goarch: arm - goarm: 6 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv6" - - "ghcr.io/gnolang/{{ .ProjectName }}:latest-armv6" - build_flag_templates: - - "--target=gno-alpine" - - "--platform=linux/arm/v6" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gno - extra_files: - - examples - - gnovm/stdlibs - - gnovm/tests/stdlibs - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: arm - goarm: 7 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv7" - - "ghcr.io/gnolang/{{ .ProjectName }}:latest-armv7" - build_flag_templates: - - "--target=gno-alpine" - - "--platform=linux/arm/v7" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gno - extra_files: - - examples - - gnovm/stdlibs - - gnovm/tests/stdlibs - - # gnoland - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: amd64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-amd64" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-amd64" - build_flag_templates: - - "--target=gnoland-alpine" - - "--platform=linux/amd64" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoland - extra_files: - - gno.land/genesis/genesis_balances.txt - - gno.land/genesis/genesis_txs.jsonl - - examples - - gnovm/stdlibs - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: arm64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-arm64v8" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-arm64v8" - build_flag_templates: - - "--platform=linux/arm64/v8" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoland - extra_files: - - gno.land/genesis/genesis_balances.txt - - gno.land/genesis/genesis_txs.jsonl - - examples - - gnovm/stdlibs - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: arm - goarm: 6 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-armv6" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-armv6" - build_flag_templates: - - "--target=gnoland-alpine" - - "--platform=linux/arm/v6" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoland - extra_files: - - gno.land/genesis/genesis_balances.txt - - gno.land/genesis/genesis_txs.jsonl - - examples - - gnovm/stdlibs - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: arm - goarm: 7 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-armv7" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-armv7" - build_flag_templates: - - "--target=gnoland-alpine" - - "--platform=linux/arm/v7" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoland" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoland - extra_files: - - gno.land/genesis/genesis_balances.txt - - gno.land/genesis/genesis_txs.jsonl - - examples - - gnovm/stdlibs - # gnokey - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: amd64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-amd64" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-amd64" - build_flag_templates: - - "--platform=linux/amd64" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnokey - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: arm64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-arm64v8" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-arm64v8" - build_flag_templates: - - "--target=gnokey-alpine" - - "--platform=linux/arm64/v8" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnokey - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: arm - goarm: 6 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-armv6" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-armv6" - build_flag_templates: - - "--target=gnokey-alpine" - - "--platform=linux/arm/v6" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnokey - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: arm - goarm: 7 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-armv7" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-armv7" - build_flag_templates: - - "--target=gnokey-alpine" - - "--platform=linux/arm/v7" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnokey" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnokey - - # gnoweb - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: amd64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-amd64" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-amd64" - build_flag_templates: - - "--target=gnoweb-alpine" - - "--platform=linux/amd64" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoweb - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: arm64 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-arm64v8" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-arm64v8" - build_flag_templates: - - "--target=gnoweb-alpine" - - "--platform=linux/arm64/v8" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoweb - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: arm - goarm: 6 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-armv6" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-armv6" - build_flag_templates: - - "--target=gnoweb-alpine" - - "--platform=linux/arm/v6" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoweb - - use: buildx - dockerfile: Dockerfile - goos: linux - goarch: arm - goarm: 7 - image_templates: - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-armv7" - - "ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-armv7" - build_flag_templates: - - "--target=gnoweb-alpine" - - "--platform=linux/arm/v7" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.title={{.ProjectName}}/gnoweb" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - ids: - - gnoweb - -docker_manifests: - # https://goreleaser.com/customization/docker_manifest/ - - # gno - - name_template: ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }} - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}:{{ .Version }}-armv7 - - name_template: ghcr.io/gnolang/{{ .ProjectName }}:latest - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}:latest-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}:latest-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}:latest-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}:latest-armv7 - - # gnoland - - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }} - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:{{ .Version }}-armv7 - - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoland:latest-armv7 - - # gnokey - - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }} - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:{{ .Version }}-armv7 - - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}/gnokey:latest-armv7 - - # gnoweb - - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }} - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:{{ .Version }}-armv7 - - name_template: ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest - image_templates: - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-amd64 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-arm64v8 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-armv6 - - ghcr.io/gnolang/{{ .ProjectName }}/gnoweb:latest-armv7 - -docker_signs: - - cmd: cosign - env: - - COSIGN_EXPERIMENTAL=1 - artifacts: images - output: true - args: - - "sign" - - "${artifact}" - - "--yes" # needed on cosign 2.0.0+ - checksum: name_template: "checksums.txt" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000000..b61870ce826 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,133 @@ +name: docker +on: + pull_request: + paths: + - "**" + - "misc/loop" + - "!misc/**" + - "!docs/**" + - "!**.md" + push: + branches: + - master + - ci/docker + tags: + - "v*" + +# concurrency: +# group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} +# cancel-in-progress: true + +jobs: + build-docker-image-main: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + if: (github.event_name != 'pull_request') + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Go Build Cache for Docker + uses: actions/cache@v3 + with: + path: go-build-cache + key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} + + - name: inject go-build-cache into docker + # v1 was composed of two actions: "inject" and "extract". + # v2 is unified to a single action. + uses: reproducible-containers/buildkit-cache-dance@v2.1.2 + with: + cache-source: go-build-cache + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=raw,value=latest + type=semver,pattern=v{{version}} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + target: ${{ matrix.target }} + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + cache-from: type=gha + cache-to: type=gha,mode=max + tags: | + ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest + ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ steps.commit.outputs.sha }} + + build-docker-images: + runs-on: ubuntu-latest + needs: build-docker-image-main + strategy: + matrix: + target: + - gnoland-alpine + - gnokey-alpine + - gno-alpine + # - gnofaucet-alpine + - gnoweb-alpine + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + if: (github.event_name != 'pull_request') + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Go Build Cache for Docker + uses: actions/cache@v3 + with: + path: go-build-cache + key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} + + - name: inject go-build-cache into docker + # v1 was composed of two actions: "inject" and "extract". + # v2 is unified to a single action. + uses: reproducible-containers/buildkit-cache-dance@v2.1.2 + with: + cache-source: go-build-cache + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=raw,value=latest + type=semver,pattern=v{{version}} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + target: ${{ matrix.target }} + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + cache-from: type=gha + cache-to: type=gha,mode=max + tags: | + ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ matrix.target }}:latest + ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ matrix.target }}:${{ steps.commit.outputs.sha }} From 885558cbead5e53bf0bc41582ba92f678a44ed12 Mon Sep 17 00:00:00 2001 From: albttx Date: Sun, 26 May 2024 10:17:42 +0100 Subject: [PATCH 04/13] chore: remove branch ci/docker --- .github/workflows/docker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b61870ce826..9af870841d1 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,7 +10,6 @@ on: push: branches: - master - - ci/docker tags: - "v*" From c35964c4556d71df835fbf4db774641075de5239 Mon Sep 17 00:00:00 2001 From: albttx Date: Sun, 26 May 2024 10:22:07 +0100 Subject: [PATCH 05/13] fix: workflow --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9af870841d1..2c72ac39d6d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -9,9 +9,9 @@ on: - "!**.md" push: branches: - - master - tags: - - "v*" + - "master" + tags: + - "v*" # concurrency: # group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} From 93b71984a2fe1571160d913da1072d692455f921 Mon Sep 17 00:00:00 2001 From: albttx Date: Sun, 26 May 2024 10:24:05 +0100 Subject: [PATCH 06/13] fix: build all without matrix --- .github/workflows/docker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2c72ac39d6d..498fe3615d3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -61,7 +61,6 @@ jobs: uses: docker/build-push-action@v5 with: context: . - target: ${{ matrix.target }} platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} cache-from: type=gha From 71827d1b4088f9d3d800cf815d732d2f71b12c7f Mon Sep 17 00:00:00 2001 From: albttx Date: Sun, 26 May 2024 10:33:51 +0100 Subject: [PATCH 07/13] chore: use docker meta --- .github/workflows/docker.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 498fe3615d3..908fc4fa345 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -65,9 +65,8 @@ jobs: push: ${{ github.event_name != 'pull_request' }} cache-from: type=gha cache-to: type=gha,mode=max - tags: | - ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest - ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ steps.commit.outputs.sha }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} build-docker-images: runs-on: ubuntu-latest @@ -126,6 +125,5 @@ jobs: push: ${{ github.event_name != 'pull_request' }} cache-from: type=gha cache-to: type=gha,mode=max - tags: | - ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ matrix.target }}:latest - ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ matrix.target }}:${{ steps.commit.outputs.sha }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From bf89f61b7e94f4d2385dd002edd9e9823891f17e Mon Sep 17 00:00:00 2001 From: albttx Date: Sun, 26 May 2024 10:43:04 +0100 Subject: [PATCH 08/13] fix: gopath --- Dockerfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2b54288c29a..e3775d2d98e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,35 +24,35 @@ WORKDIR /gnoroot # alpine images FROM runtime-base AS gno-alpine -COPY --from=build-gno /usr/local/go/bin/gno /usr/bin/ +COPY --from=build-gno /go/bin/gno /usr/bin/ ENTRYPOINT ["/usr/bin/gno"] FROM runtime-base AS gnoland-alpine -COPY --from=build-gno /usr/local/go/bin/gnoland /usr/bin/ +COPY --from=build-gno /go/bin/gnoland /usr/bin/ EXPOSE 26657 26657 ENTRYPOINT ["/usr/bin/gnoland"] FROM runtime-base AS gnokey-alpine -COPY --from=build-gno /usr/local/go/bin/gnokey /usr/bin/ +COPY --from=build-gno /go/bin/gnokey /usr/bin/ ENTRYPOINT ["/usr/bin/gnokey"] FROM runtime-base AS gnofaucet-alpine -COPY --from=build-faucet /usr/local/go/bin/gnofaucet /usr/bin/ +COPY --from=build-faucet /go/bin/gnofaucet /usr/bin/ EXPOSE 5050 ENTRYPOINT ["/usr/bin/gnofaucet"] FROM runtime-base AS gnoweb-alpine -COPY --from=build-gno /usr/local/go/bin/gnoweb /usr/bin/ +COPY --from=build-gno /go/bin/gnoweb /usr/bin/ COPY --from=build-gno /gnoroot/gno.land/cmd/gnoweb /gnoroot/src/gnoweb EXPOSE 8888 ENTRYPOINT ["/usr/bin/gnoweb"] # all, contains everything. FROM runtime-base AS all -COPY --from=build-gno /usr/local/go/bin/gnoland /usr/bin/ -COPY --from=build-gno /usr/local/go/bin/gnokey /usr/bin/ -COPY --from=build-gno /usr/local/go/bin/gno /usr/bin/ -COPY --from=build-gno /usr/local/go/bin/gnoweb /usr/bin/ +COPY --from=build-gno /go/bin/gno /usr/bin/ +COPY --from=build-gno /go/bin/gnoland /usr/bin/ +COPY --from=build-gno /go/bin/gnokey /usr/bin/ +COPY --from=build-gno /go/bin/gnoweb /usr/bin/ # COPY --from=build-gno /gnoroot/gno.land/cmd/gnoweb /gnoroot/src/gnoweb COPY --from=build-gno /gnoroot /gnoroot From a9ba00966b9bb5a7c1a39e6f3b4d43d453e2da06 Mon Sep 17 00:00:00 2001 From: albttx Date: Sun, 26 May 2024 11:02:34 +0100 Subject: [PATCH 09/13] chore: fixes --- .github/workflows/docker.yml | 14 +++++--------- Dockerfile | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 908fc4fa345..2e5099d8bf0 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,9 +13,9 @@ on: tags: - "v*" -# concurrency: -# group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} -# cancel-in-progress: true +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: build-docker-image-main: @@ -42,9 +42,7 @@ jobs: key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} - name: inject go-build-cache into docker - # v1 was composed of two actions: "inject" and "extract". - # v2 is unified to a single action. - uses: reproducible-containers/buildkit-cache-dance@v2.1.2 + uses: reproducible-containers/buildkit-cache-dance@v3.1.0 with: cache-source: go-build-cache @@ -101,9 +99,7 @@ jobs: key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} - name: inject go-build-cache into docker - # v1 was composed of two actions: "inject" and "extract". - # v2 is unified to a single action. - uses: reproducible-containers/buildkit-cache-dance@v2.1.2 + uses: reproducible-containers/buildkit-cache-dance@v3.1.0 with: cache-source: go-build-cache diff --git a/Dockerfile b/Dockerfile index e3775d2d98e..21f632bf1b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ ENTRYPOINT ["/usr/bin/gno"] FROM runtime-base AS gnoland-alpine COPY --from=build-gno /go/bin/gnoland /usr/bin/ -EXPOSE 26657 26657 +EXPOSE 26656 26657 ENTRYPOINT ["/usr/bin/gnoland"] FROM runtime-base AS gnokey-alpine From 87ce5dff8d10c9786cde125262e3a02cca1d6510 Mon Sep 17 00:00:00 2001 From: albttx Date: Sun, 26 May 2024 11:26:33 +0100 Subject: [PATCH 10/13] chore: cache key update --- .github/workflows/docker.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2e5099d8bf0..23456726065 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -40,6 +40,8 @@ jobs: with: path: go-build-cache key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-build-cache- - name: inject go-build-cache into docker uses: reproducible-containers/buildkit-cache-dance@v3.1.0 @@ -97,6 +99,8 @@ jobs: with: path: go-build-cache key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go-build-cache- - name: inject go-build-cache into docker uses: reproducible-containers/buildkit-cache-dance@v3.1.0 From ec39dba6f6eca885d2a33eb3e8c21834a74dbc64 Mon Sep 17 00:00:00 2001 From: albttx Date: Sun, 26 May 2024 11:27:46 +0100 Subject: [PATCH 11/13] chore: fix typo --- .github/workflows/docker.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 23456726065..89708d579a5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -40,8 +40,8 @@ jobs: with: path: go-build-cache key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go-build-cache- + restore-keys: | + ${{ runner.os }}-go-build-cache- - name: inject go-build-cache into docker uses: reproducible-containers/buildkit-cache-dance@v3.1.0 @@ -99,8 +99,8 @@ jobs: with: path: go-build-cache key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go-build-cache- + restore-keys: | + ${{ runner.os }}-go-build-cache- - name: inject go-build-cache into docker uses: reproducible-containers/buildkit-cache-dance@v3.1.0 From e89490519b276ff036e6e84a5288efe586fbc741 Mon Sep 17 00:00:00 2001 From: albttx Date: Mon, 27 May 2024 09:51:28 +0100 Subject: [PATCH 12/13] chore: fix copy files --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 21f632bf1b6..a8d00b36554 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,6 +55,7 @@ COPY --from=build-gno /go/bin/gnokey /usr/bin/ COPY --from=build-gno /go/bin/gnoweb /usr/bin/ # COPY --from=build-gno /gnoroot/gno.land/cmd/gnoweb /gnoroot/src/gnoweb -COPY --from=build-gno /gnoroot /gnoroot +COPY --from=build-gno /gnoroot/examples /gnoroot/examples +COPY --from=build-gno /gnoroot/gno.land /gnoroot/gno.land # gofmt is required by `gnokey maketx addpkg` -COPY --from=build-gno /usr/local/go/bin/gofmt /usr/bin +COPY --from=build-gno /usr/local/go/bin/gofmt /usr/bin/ From 91bffd8154670e92219247f13aa14639d1134e88 Mon Sep 17 00:00:00 2001 From: albttx Date: Mon, 27 May 2024 09:53:40 +0100 Subject: [PATCH 13/13] chore: fix copy files --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a8d00b36554..67511b3936c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,8 @@ ENTRYPOINT ["/usr/bin/gno"] FROM runtime-base AS gnoland-alpine COPY --from=build-gno /go/bin/gnoland /usr/bin/ +COPY --from=build-gno /gnoroot/examples /gnoroot/examples +COPY --from=build-gno /gnoroot/gno.land /gnoroot/gno.land EXPOSE 26656 26657 ENTRYPOINT ["/usr/bin/gnoland"] @@ -43,7 +45,6 @@ ENTRYPOINT ["/usr/bin/gnofaucet"] FROM runtime-base AS gnoweb-alpine COPY --from=build-gno /go/bin/gnoweb /usr/bin/ -COPY --from=build-gno /gnoroot/gno.land/cmd/gnoweb /gnoroot/src/gnoweb EXPOSE 8888 ENTRYPOINT ["/usr/bin/gnoweb"] @@ -53,7 +54,6 @@ COPY --from=build-gno /go/bin/gno /usr/bin/ COPY --from=build-gno /go/bin/gnoland /usr/bin/ COPY --from=build-gno /go/bin/gnokey /usr/bin/ COPY --from=build-gno /go/bin/gnoweb /usr/bin/ -# COPY --from=build-gno /gnoroot/gno.land/cmd/gnoweb /gnoroot/src/gnoweb COPY --from=build-gno /gnoroot/examples /gnoroot/examples COPY --from=build-gno /gnoroot/gno.land /gnoroot/gno.land