Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce official Docker image #1819

Merged
merged 1 commit into from
Mar 18, 2024
Merged

Introduce official Docker image #1819

merged 1 commit into from
Mar 18, 2024

Conversation

aofei
Copy link
Member

@aofei aofei commented Mar 15, 2024

Fixes #1818


Note that this feature requires the Workflow permissions to be set to Read and write permissions.

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.57%. Comparing base (d4166d2) to head (5fd2e7a).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1819      +/-   ##
==========================================
+ Coverage   92.45%   92.57%   +0.12%     
==========================================
  Files          40       42       +2     
  Lines       11232    11418     +186     
==========================================
+ Hits        10384    10570     +186     
  Misses        686      686              
  Partials      162      162              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Dockerfile Show resolved Hide resolved
Copy link
Contributor

@cpunion cpunion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about skipping goreleaser builds in Dockerfile? This might simplify things. Thoughts?

@aofei
Copy link
Member Author

aofei commented Mar 17, 2024

Hi @cpunion 👋

How about skipping goreleaser builds in Dockerfile? This might simplify things. Thoughts?

I'm open to building directly within the Dockerfile, but baking GoReleaser-generated artifacts into the image ensures they are identical to those from GitHub Releases, which could be beneficial. Building in the Dockerfile may be better suited for debugging, so I've maintained that option.

Regarding your mention of "Run failed both on macOS M1 and Ubuntu 22.04 amd64", could you specify the failure point? Was it during goreleaser release --snapshot --clean --skip winget,nfpm,snapcraft, docker build …, or did the built image not perform as expected? There shouldn't be any missing files, as the copying rules are from here. In my tests on macOS Apple Silicon and in GitHub Actions on Ubuntu 22.04, everything ran smoothly. The image was also successfully published to GitHub Packages.

@cpunion
Copy link
Contributor

cpunion commented Mar 17, 2024

Hi @cpunion 👋

How about skipping goreleaser builds in Dockerfile? This might simplify things. Thoughts?

I'm open to building directly within the Dockerfile, but baking GoReleaser-generated artifacts into the image ensures they are identical to those from GitHub Releases, which could be beneficial. Building in the Dockerfile may be better suited for debugging, so I've maintained that option.

Okay, that makes sense. Just a small issue, docker always have two different build steps.

Regarding your mention of "Run failed both on macOS M1 and Ubuntu 22.04 amd64", could you specify the failure point? Was it during goreleaser release --snapshot --clean --skip winget,nfpm,snapcraft, docker build …, or did the built image not perform as expected? There shouldn't be any missing files, as the copying rules are from here. In my tests on macOS Apple Silicon and in GitHub Actions on Ubuntu 22.04, everything ran smoothly. The image was also successfully published to GitHub Packages.

In your github action link above (# 8) skiped docker build. But seems your build # 9 success.

I can't verify this locally, the full logs are attached below, are there some steps I missing?

(base) ➜  gop git:(dockerimage) goreleaser release --snapshot --clean --skip winget,snapcraft 
  • starting release...
  • loading                                          path=.goreleaser.yaml
  • skipping announce, publish, snapcraft, validate and winget...
  • loading environment variables
  • getting and validating git state
    • git state                                      commit=d05b84a18335f24f0e59a249eaf0d29aeb9a54b8 branch=dockerimage current_tag=v1.2.0-pre.1 previous_tag=v1.1.3 dirty=false
    • pipe skipped                                   reason=disabled during snapshot mode
  • parsing tag
  • setting defaults
  • snapshotting
    • building snapshot...                           version=1.2.0-pre.1-SNAPSHOT-d05b84a1
  • running before hooks
    • running                                        hook=go mod tidy
  • checking distribution directory
    • cleaning .dist
  • loading go mod information
  • build prerequisites
  • writing effective config file
    • writing                                        config=.dist/config.yaml
  • building binaries
    • building                                       binary=.dist/gopfmt_linux_arm64/bin/gopfmt
    • building                                       binary=.dist/gop_darwin_amd64_v1/bin/gop
    • building                                       binary=.dist/gop_linux_amd64_v1/bin/gop
    • building                                       binary=.dist/gopfmt_linux_amd64_v1/bin/gopfmt
    • building                                       binary=.dist/gop_windows_386/bin/gop.exe
    • building                                       binary=.dist/gop_linux_arm64/bin/gop
    • building                                       binary=.dist/gop_windows_arm64/bin/gop.exe
    • building                                       binary=.dist/gop_linux_386/bin/gop
    • building                                       binary=.dist/gop_darwin_arm64/bin/gop
    • building                                       binary=.dist/gop_windows_amd64_v1/bin/gop.exe
    • building                                       binary=.dist/gopfmt_linux_386/bin/gopfmt
    • building                                       binary=.dist/gopfmt_windows_amd64_v1/bin/gopfmt.exe
    • building                                       binary=.dist/gopfmt_windows_arm64/bin/gopfmt.exe
    • building                                       binary=.dist/gopfmt_windows_386/bin/gopfmt.exe
    • building                                       binary=.dist/gopfmt_darwin_amd64_v1/bin/gopfmt
    • building                                       binary=.dist/gopfmt_darwin_arm64/bin/gopfmt
    • took: 3s
  • archives
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Darwin_arm64.tar.gz
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Windows_x86_64.zip
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_i386.tar.gz
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Windows_arm64.zip
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Darwin_x86_64.tar.gz
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_arm64.tar.gz
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_x86_64.tar.gz
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Windows_i386.zip
    • took: 3s
  • linux packages
    • creating                                       package=gop format=deb arch=386 file=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_i386.deb
    • creating                                       package=gop format=rpm arch=amd64v1 file=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_x86_64.rpm
    • creating                                       package=gop format=rpm arch=arm64 file=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_arm64.rpm
    • creating                                       package=gop format=deb arch=arm64 file=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_arm64.deb
    • creating                                       package=gop format=rpm arch=386 file=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_i386.rpm
    • creating                                       package=gop format=deb arch=amd64v1 file=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_x86_64.deb
    • took: 1s
  • calculating checksums
  • docker images
    • building docker image                          image=ghcr.io/goplus/gop:v1.2.0-pre.1-SNAPSHOT-d05b84a1-i386
    • building docker image                          image=ghcr.io/goplus/gop:v1.2.0-pre.1-SNAPSHOT-d05b84a1-arm64
    • building docker image                          image=ghcr.io/goplus/gop:v1.2.0-pre.1-SNAPSHOT-d05b84a1-x86_64
    • took: 20s
  ⨯ release failed after 26s                 error=docker build failed: failed to build ghcr.io/goplus/gop:v1.2.0-pre.1-SNAPSHOT-d05b84a1-i386: exit status 1: #0 building with "default" instance using docker driver

#1 [internal] load .dockerignore
#1 transferring context:
#1 transferring context: 2B done
#1 DONE 0.1s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 906B done
#2 DONE 0.1s

#3 [internal] load metadata for docker.io/library/golang:1.22-bookworm
#3 DONE 2.7s

#4 [build 1/4] FROM docker.io/library/golang:1.22-bookworm@sha256:d996c645c9934e770e64f05fc2bc103755197b43fd999b3aa5419142e1ee6d78
#4 CACHED

#5 [internal] load build context
#5 transferring context: 353.35MB 2.4s
#5 transferring context: 469.96MB 3.4s done
#5 DONE 5.7s

#6 [build 2/4] WORKDIR /usr/local/src/gop
#6 CACHED

#7 [build 3/4] COPY . .
#7 DONE 3.7s

#8 [build 4/4] RUN set -eux;    mkdir -p /usr/local/gop/bin;    cp LICENSE *.mod *.sum *.md /usr/local/gop/;    for PATTERN in "*.go" "*.md"; do          find . -mindepth 2 -name "$PATTERN" -exec cp --parents {} /usr/local/gop/ ;;      done;   if [ -d .dist ]; then           GOARCH=$(go env GOARCH);                BIN_DIR_SUFFIX=linux_$GOARCH;             [ $GOARCH = "amd64" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_v1;           [ $GOARCH = "arm" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_$(go env GOARM | cut -d , -f 1);          cp .dist/gop_$BIN_DIR_SUFFIX/bin/gop .dist/gopfmt_$BIN_DIR_SUFFIX/bin/gopfmt /usr/local/gop/bin/;         else            ./all.bash;             cp bin/gop bin/gopfmt /usr/local/gop/bin/;        fi
#8 0.218 + mkdir -p /usr/local/gop/bin
#8 0.244 + cp LICENSE go.mod go.sum README.md /usr/local/gop/
#8 0.268 + find . -mindepth 2 -name *.go -exec cp --parents {} /usr/local/gop/ ;
#8 4.225 + find . -mindepth 2 -name *.md -exec cp --parents {} /usr/local/gop/ ;
#8 4.494 + [ -d .dist ]
#8 4.495 + go env GOARCH
#8 4.540 SIGSEGV: segmentation violation
#8 4.540 PC=0x8097aef m=1 sigcode=1 addr=0x4f0
#8 4.540 
#8 4.540 goroutine 0 gp=0x8c06368 m=1 mp=0x8c42008 [idle]:
#8 4.542 runtime.runqput(0x0, 0x8c06488, 0x1)
#8 4.542        runtime/proc.go:6642 +0xaf fp=0x40800d68 sp=0x40800d48 pc=0x8097aef
#8 4.542 runtime.newproc.func1()
#8 4.542        runtime/proc.go:4881 +0x56 fp=0x40800d7c sp=0x40800d68 pc=0x80932b6
#8 4.542 runtime.systemstack(0xb02760)
#8 4.542        runtime/asm_386.s:374 +0x41 fp=0x40800d80 sp=0x40800d7c pc=0x80bfa41
#8 4.543 
#8 4.543 goroutine 1 gp=0x8c06128 m=0 mp=0x8b03820 [running, locked to thread]:
#8 4.543        goroutine running on other thread; stack unavailable
#8 4.543 
#8 4.543 goroutine 2 gp=0x8c06488 m=nil [runnable]:
#8 4.543 runtime.forcegchelper()
#8 4.543        runtime/proc.go:317 fp=0x8c3dff0 sp=0x8c3dfec pc=0x8089db0
#8 4.543 runtime.goexit({})
#8 4.543        runtime/asm_386.s:1363 +0x1 fp=0x8c3dff4 sp=0x8c3dff0 pc=0x80c0dd1
#8 4.543 created by runtime.init.5 in goroutine 1
#8 4.543        runtime/proc.go:314 +0x23
#8 4.543 
#8 4.543 eax    0x0
#8 4.543 ebx    0x8c06488
#8 4.544 ecx    0x8c06368
#8 4.544 edx    0x0
#8 4.544 edi    0x8c064d0
#8 4.544 esi    0x8c42008
#8 4.544 ebp    0x8c06368
#8 4.544 esp    0x40800d48
#8 4.544 eip    0x8097aef
#8 4.544 eflags 0x202
#8 4.544 cs     0x23
#8 4.544 fs     0x0
#8 4.544 gs     0x33
#8 4.545 + GOARCH=
#8 ERROR: process "/bin/sh -c set -eux; \tmkdir -p $GOPROOT/bin; \tcp LICENSE *.mod *.sum *.md $GOPROOT/; \tfor PATTERN in \"*.go\" \"*.md\"; do \t\tfind . -mindepth 2 -name \"$PATTERN\" -exec cp --parents {} $GOPROOT/ \\;; \tdone; \tif [ -d .dist ]; then \t\tGOARCH=$(go env GOARCH); \t\tBIN_DIR_SUFFIX=linux_$GOARCH; \t\t[ $GOARCH = \"amd64\" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_v1; \t\t[ $GOARCH = \"arm\" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_$(go env GOARM | cut -d , -f 1); \t\tcp .dist/gop_$BIN_DIR_SUFFIX/bin/gop .dist/gopfmt_$BIN_DIR_SUFFIX/bin/gopfmt $GOPROOT/bin/; \telse \t\t./all.bash; \t\tcp bin/gop bin/gopfmt $GOPROOT/bin/; \tfi" did not complete successfully: exit code: 2
------
 > [build 4/4] RUN set -eux;    mkdir -p /usr/local/gop/bin;    cp LICENSE *.mod *.sum *.md /usr/local/gop/;    for PATTERN in "*.go" "*.md"; do          find . -mindepth 2 -name "$PATTERN" -exec cp --parents {} /usr/local/gop/ ;;      done;   if [ -d .dist ]; then           GOARCH=$(go env GOARCH);                BIN_DIR_SUFFIX=linux_$GOARCH;             [ $GOARCH = "amd64" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_v1;           [ $GOARCH = "arm" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_$(go env GOARM | cut -d , -f 1);          cp .dist/gop_$BIN_DIR_SUFFIX/bin/gop .dist/gopfmt_$BIN_DIR_SUFFIX/bin/gopfmt /usr/local/gop/bin/;         else            ./all.bash;             cp bin/gop bin/gopfmt /usr/local/gop/bin/;        fi:
4.544 edi    0x8c064d0
4.544 esi    0x8c42008
4.544 ebp    0x8c06368
4.544 esp    0x40800d48
4.544 eip    0x8097aef
4.544 eflags 0x202
4.544 cs     0x23
4.544 fs     0x0
4.544 gs     0x33
4.545 + GOARCH=
------
Dockerfile:7
--------------------
   6 |     ENV GOPROOT=/usr/local/gop
   7 | >>> RUN set -eux; \
   8 | >>>      mkdir -p $GOPROOT/bin; \
   9 | >>>      cp LICENSE *.mod *.sum *.md $GOPROOT/; \
  10 | >>>      for PATTERN in "*.go" "*.md"; do \
  11 | >>>              find . -mindepth 2 -name "$PATTERN" -exec cp --parents {} $GOPROOT/ \;; \
  12 | >>>      done; \
  13 | >>>      if [ -d .dist ]; then \
  14 | >>>              GOARCH=$(go env GOARCH); \
  15 | >>>              BIN_DIR_SUFFIX=linux_$GOARCH; \
  16 | >>>              [ $GOARCH = "amd64" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_v1; \
  17 | >>>              [ $GOARCH = "arm" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_$(go env GOARM | cut -d , -f 1); \
  18 | >>>              cp .dist/gop_$BIN_DIR_SUFFIX/bin/gop .dist/gopfmt_$BIN_DIR_SUFFIX/bin/gopfmt $GOPROOT/bin/; \
  19 | >>>      else \
  20 | >>>              ./all.bash; \
  21 | >>>              cp bin/gop bin/gopfmt $GOPROOT/bin/; \
  22 | >>>      fi
  23 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c set -eux; \tmkdir -p $GOPROOT/bin; \tcp LICENSE *.mod *.sum *.md $GOPROOT/; \tfor PATTERN in \"*.go\" \"*.md\"; do \t\tfind . -mindepth 2 -name \"$PATTERN\" -exec cp --parents {} $GOPROOT/ \\;; \tdone; \tif [ -d .dist ]; then \t\tGOARCH=$(go env GOARCH); \t\tBIN_DIR_SUFFIX=linux_$GOARCH; \t\t[ $GOARCH = \"amd64\" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_v1; \t\t[ $GOARCH = \"arm\" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_$(go env GOARM | cut -d , -f 1); \t\tcp .dist/gop_$BIN_DIR_SUFFIX/bin/gop .dist/gopfmt_$BIN_DIR_SUFFIX/bin/gopfmt $GOPROOT/bin/; \telse \t\t./all.bash; \t\tcp bin/gop bin/gopfmt $GOPROOT/bin/; \tfi" did not complete successfully: exit code: 2

Learn more at https://goreleaser.com/errors/docker-build

Full build log on Ubuntu 22.04 amd64:

(lijie) ➜  gop git:(dockerimage) WINGET_PKGS_PRIVATE_KEY= GITHUB_REPOSITORY_OWNER= goreleaser release --snapshot --clean --skip publish,snapcraft
  • starting release...
  • loading                                          path=.goreleaser.yaml
  • skipping announce, publish, snapcraft and validate...
  • loading environment variables
  • getting and validating git state
    • git state                                      commit=d05b84a18335f24f0e59a249eaf0d29aeb9a54b8 branch=dockerimage current_tag=v1.2.0-pre.1 previous_tag=v1.1.3 dirty=false
    • pipe skipped                                   reason=disabled during snapshot mode
  • parsing tag
  • setting defaults
  • snapshotting
    • building snapshot...                           version=1.2.0-pre.1-SNAPSHOT-d05b84a1
  • running before hooks
    • running                                        hook=go mod tidy
  • checking distribution directory
    • cleaning .dist
  • loading go mod information
  • build prerequisites
  • writing effective config file
    • writing                                        config=.dist/config.yaml
  • building binaries
    • building                                       binary=.dist/gopfmt_darwin_arm64/bin/gopfmt
    • building                                       binary=.dist/gop_linux_386/bin/gop
    • building                                       binary=.dist/gop_darwin_amd64_v1/bin/gop
    • building                                       binary=.dist/gopfmt_linux_arm64/bin/gopfmt
    • building                                       binary=.dist/gop_windows_386/bin/gop.exe
    • building                                       binary=.dist/gop_linux_amd64_v1/bin/gop
    • building                                       binary=.dist/gopfmt_linux_386/bin/gopfmt
    • building                                       binary=.dist/gop_darwin_arm64/bin/gop
    • building                                       binary=.dist/gopfmt_darwin_amd64_v1/bin/gopfmt
    • building                                       binary=.dist/gopfmt_windows_386/bin/gopfmt.exe
    • building                                       binary=.dist/gop_linux_arm64/bin/gop
    • building                                       binary=.dist/gopfmt_linux_amd64_v1/bin/gopfmt
    • building                                       binary=.dist/gopfmt_windows_arm64/bin/gopfmt.exe
    • building                                       binary=.dist/gop_windows_amd64_v1/bin/gop.exe
    • building                                       binary=.dist/gop_windows_arm64/bin/gop.exe
    • building                                       binary=.dist/gopfmt_windows_amd64_v1/bin/gopfmt.exe
    • took: 1s
  • archives
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Windows_i386.zip
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Windows_arm64.zip
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_x86_64.tar.gz
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Darwin_arm64.tar.gz
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Windows_x86_64.zip
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_i386.tar.gz
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_arm64.tar.gz
    • creating                                       archive=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Darwin_x86_64.tar.gz
    • took: 2s
  • linux packages
    • creating                                       package=gop format=deb arch=amd64v1 file=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_x86_64.deb
    • creating                                       package=gop format=rpm arch=arm64 file=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_arm64.rpm
    • creating                                       package=gop format=deb arch=arm64 file=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_arm64.deb
    • creating                                       package=gop format=rpm arch=386 file=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_i386.rpm
    • creating                                       package=gop format=rpm arch=amd64v1 file=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_x86_64.rpm
    • creating                                       package=gop format=deb arch=386 file=.dist/gop_v1.2.0-pre.1-SNAPSHOT-d05b84a1_Linux_i386.deb
    • took: 1s
  • calculating checksums
  • winget
    • writing                                        path=.dist/winget/manifests/g/goplus/gop/1.2.0-pre.1-SNAPSHOT-d05b84a1/goplus.gop.yaml
    • writing                                        path=.dist/winget/manifests/g/goplus/gop/1.2.0-pre.1-SNAPSHOT-d05b84a1/goplus.gop.installer.yaml
    • writing                                        path=.dist/winget/manifests/g/goplus/gop/1.2.0-pre.1-SNAPSHOT-d05b84a1/goplus.gop.locale.en-US.yaml
  • docker images
    • building docker image                          image=ghcr.io/goplus/gop:v1.2.0-pre.1-SNAPSHOT-d05b84a1-arm64
    • building docker image                          image=ghcr.io/goplus/gop:v1.2.0-pre.1-SNAPSHOT-d05b84a1-x86_64
    • building docker image                          image=ghcr.io/goplus/gop:v1.2.0-pre.1-SNAPSHOT-d05b84a1-i386
    • took: 3m29s
  ⨯ release failed after 3m33s               error=docker build failed: failed to build ghcr.io/goplus/gop:v1.2.0-pre.1-SNAPSHOT-d05b84a1-arm64: exit status 1: #0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 906B done
#1 DONE 0.0s

#2 [internal] load metadata for docker.io/library/golang:1.22-bookworm
#2 DONE 4.7s

#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s

#4 [build 1/4] FROM docker.io/library/golang:1.22-bookworm@sha256:d996c645c9934e770e64f05fc2bc103755197b43fd999b3aa5419142e1ee6d78
#4 resolve docker.io/library/golang:1.22-bookworm@sha256:d996c645c9934e770e64f05fc2bc103755197b43fd999b3aa5419142e1ee6d78 done
#4 sha256:3b3fecb519465a8c385efb1db645dec61b04e8520a2ab018878688f07c153828 1.79kB / 1.79kB done
#4 sha256:d9e9f02e714944640a9f56cea3c4641959d56c3520b043d9c3425ff6bef78222 2.90kB / 2.90kB done
#4 sha256:d996c645c9934e770e64f05fc2bc103755197b43fd999b3aa5419142e1ee6d78 1.64kB / 1.64kB done
#4 ...

#5 [internal] load build context
#5 transferring context: 462.95MB 0.8s done
#5 DONE 0.8s

#4 [build 1/4] FROM docker.io/library/golang:1.22-bookworm@sha256:d996c645c9934e770e64f05fc2bc103755197b43fd999b3aa5419142e1ee6d78
#4 sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 0B / 32B 45.0s
#4 sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 32B / 32B 45.3s done
#4 sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 0B / 32B 122.1s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 0B / 49.59MB 122.5s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 3.15MB / 49.59MB 125.1s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 6.29MB / 49.59MB 127.5s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 9.44MB / 49.59MB 129.5s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 12.58MB / 49.59MB 131.7s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 15.73MB / 49.59MB 133.5s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 18.87MB / 49.59MB 135.5s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 22.02MB / 49.59MB 137.6s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 25.17MB / 49.59MB 139.6s
#4 sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 0B / 23.58MB 139.9s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 0B / 63.99MB 140.1s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 28.31MB / 49.59MB 141.8s
#4 sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 2.10MB / 23.58MB 142.4s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 31.46MB / 49.59MB 143.5s
#4 sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 4.19MB / 23.58MB 143.6s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 4.19MB / 63.99MB 143.7s
#4 sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 6.29MB / 23.58MB 145.0s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 34.60MB / 49.59MB 145.7s
#4 sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 8.39MB / 23.58MB 146.5s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 8.39MB / 63.99MB 146.5s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 37.75MB / 49.59MB 147.7s
#4 sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 10.49MB / 23.58MB 147.7s
#4 sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 12.58MB / 23.58MB 149.1s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 12.58MB / 63.99MB 149.3s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 40.89MB / 49.59MB 149.7s
#4 sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 14.68MB / 23.58MB 150.7s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 44.04MB / 49.59MB 152.4s
#4 sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 16.78MB / 23.58MB 152.4s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 16.78MB / 63.99MB 152.4s
#4 sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 18.87MB / 23.58MB 153.8s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 47.19MB / 49.59MB 154.3s
#4 sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 20.97MB / 23.58MB 155.2s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 20.97MB / 63.99MB 155.4s
#4 sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 49.59MB / 49.59MB 155.8s done
#4 extracting sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 0.1s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 0B / 86.41MB 155.9s
#4 sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 23.07MB / 23.58MB 156.4s
#4 extracting sha256:6ee0baa58a3d368515336c1b5c1cade29c975e1b49a832f19e22f4c46f4a23a7 0.6s done
#4 sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 23.58MB / 23.58MB 156.6s done
#4 extracting sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 0.1s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 0B / 66.25MB 156.7s
#4 extracting sha256:992a857ef57584af4efb4c62d68456f1e8513c95d6248fd796a9ea7f45da4d79 0.2s done
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 25.17MB / 63.99MB 157.7s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 4.19MB / 66.25MB 160.0s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 29.36MB / 63.99MB 160.2s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 5.24MB / 86.41MB 160.2s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 33.55MB / 63.99MB 163.1s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 8.39MB / 66.25MB 163.1s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 10.49MB / 86.41MB 163.7s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 12.58MB / 66.25MB 165.7s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 37.75MB / 63.99MB 166.0s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 15.73MB / 86.41MB 167.6s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 16.78MB / 66.25MB 168.6s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 41.94MB / 63.99MB 169.0s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 20.97MB / 86.41MB 170.9s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 20.97MB / 66.25MB 171.2s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 46.14MB / 63.99MB 171.7s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 25.17MB / 66.25MB 174.0s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 50.33MB / 63.99MB 174.5s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 26.21MB / 86.41MB 174.5s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 29.36MB / 66.25MB 176.8s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 54.53MB / 63.99MB 177.2s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 31.46MB / 86.41MB 178.3s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 33.55MB / 66.25MB 179.8s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 58.72MB / 63.99MB 180.3s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 36.70MB / 86.41MB 181.6s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 37.75MB / 66.25MB 182.8s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 62.91MB / 63.99MB 183.2s
#4 sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 63.99MB / 63.99MB 184.0s done
#4 extracting sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 0.1s
#4 sha256:a240b3b808d917b5d8f2b7c06dc7ebd0517be84e95e48cbb79f15df84b7f5015 0B / 174B 184.0s
#4 sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 0B / 32B 184.4s
#4 sha256:a240b3b808d917b5d8f2b7c06dc7ebd0517be84e95e48cbb79f15df84b7f5015 174B / 174B 184.4s done
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 41.94MB / 86.41MB 184.9s
#4 extracting sha256:3861a6536e4e911503e7d2fc8f93228491ba45d1e5def0d2f3723e32e03d7466 0.8s done
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 41.94MB / 66.25MB 185.1s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 47.19MB / 86.41MB 187.1s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 46.14MB / 66.25MB 187.1s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 50.33MB / 66.25MB 188.9s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 52.43MB / 86.41MB 189.4s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 54.53MB / 66.25MB 190.6s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 57.67MB / 86.41MB 191.7s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 58.72MB / 66.25MB 192.4s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 62.91MB / 86.41MB 194.1s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 62.91MB / 66.25MB 194.6s
#4 sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 66.25MB / 66.25MB 196.1s done
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 68.16MB / 86.41MB 196.6s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 73.40MB / 86.41MB 198.2s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 78.64MB / 86.41MB 199.4s
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 83.89MB / 86.41MB 200.5s
#4 extracting sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5
#4 sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 86.41MB / 86.41MB 201.0s done
#4 extracting sha256:abc7e462754aa407ba73b5f3e308e2dd9f24ad9d6692a741f7864bbd27e67eb5 0.9s done
#4 extracting sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 0.1s
#4 extracting sha256:47c6f29f6556ff45268a4fb5ba395c214cac9f4f9a57f55d27fc7ca44d1c5b4d 1.6s done
#4 extracting sha256:a240b3b808d917b5d8f2b7c06dc7ebd0517be84e95e48cbb79f15df84b7f5015
#4 extracting sha256:a240b3b808d917b5d8f2b7c06dc7ebd0517be84e95e48cbb79f15df84b7f5015 done
#4 extracting sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 done
#4 DONE 203.7s

#6 [build 2/4] WORKDIR /usr/local/src/gop
#6 DONE 0.2s

#7 [build 3/4] COPY . .
#7 DONE 0.3s

#8 [build 4/4] RUN set -eux;    mkdir -p /usr/local/gop/bin;    cp LICENSE *.mod *.sum *.md /usr/local/gop/;    for PATTERN in "*.go" "*.md"; do                find . -mindepth 2 -name "$PATTERN" -exec cp --parents {} /usr/local/gop/ ;;      done;   if [ -d .dist ]; then       GOARCH=$(go env GOARCH);                BIN_DIR_SUFFIX=linux_$GOARCH;             [ $GOARCH = "amd64" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_v1;           [ $GOARCH = "arm" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_$(go env GOARM | cut -d , -f 1);          cp .dist/gop_$BIN_DIR_SUFFIX/bin/gop .dist/gopfmt_$BIN_DIR_SUFFIX/bin/gopfmt /usr/local/gop/bin/;       else     ./all.bash;              cp bin/gop bin/gopfmt /usr/local/gop/bin/;      fi
#8 0.214 exec /bin/sh: exec format error
#8 ERROR: process "/bin/sh -c set -eux; \tmkdir -p $GOPROOT/bin; \tcp LICENSE *.mod *.sum *.md $GOPROOT/; \tfor PATTERN in \"*.go\" \"*.md\"; do \t\tfind . -mindepth 2 -name \"$PATTERN\" -exec cp --parents {} $GOPROOT/ \\;; \tdone; \tif [ -d .dist ]; then \t\tGOARCH=$(go env GOARCH); \t\tBIN_DIR_SUFFIX=linux_$GOARCH; \t\t[ $GOARCH = \"amd64\" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_v1; \t\t[ $GOARCH = \"arm\" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_$(go env GOARM | cut -d , -f 1); \t\tcp .dist/gop_$BIN_DIR_SUFFIX/bin/gop .dist/gopfmt_$BIN_DIR_SUFFIX/bin/gopfmt $GOPROOT/bin/; \telse \t\t./all.bash; \t\tcp bin/gop bin/gopfmt $GOPROOT/bin/; \tfi" did not complete successfully: exit code: 1
------
 > [build 4/4] RUN set -eux;    mkdir -p /usr/local/gop/bin;    cp LICENSE *.mod *.sum *.md /usr/local/gop/;    for PATTERN in "*.go" "*.md"; do                find . -mindepth 2 -name "$PATTERN" -exec cp --parents {} /usr/local/gop/ ;;      done;   if [ -d .dist ]; then       GOARCH=$(go env GOARCH);                BIN_DIR_SUFFIX=linux_$GOARCH;             [ $GOARCH = "amd64" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_v1;           [ $GOARCH = "arm" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_$(go env GOARM | cut -d , -f 1);          cp .dist/gop_$BIN_DIR_SUFFIX/bin/gop .dist/gopfmt_$BIN_DIR_SUFFIX/bin/gopfmt /usr/local/gop/bin/;       else     ./all.bash;              cp bin/gop bin/gopfmt /usr/local/gop/bin/;      fi:
0.214 exec /bin/sh: exec format error
------
Dockerfile:7
--------------------
   6 |     ENV GOPROOT=/usr/local/gop
   7 | >>> RUN set -eux; \
   8 | >>>      mkdir -p $GOPROOT/bin; \
   9 | >>>      cp LICENSE *.mod *.sum *.md $GOPROOT/; \
  10 | >>>      for PATTERN in "*.go" "*.md"; do \
  11 | >>>              find . -mindepth 2 -name "$PATTERN" -exec cp --parents {} $GOPROOT/ \;; \
  12 | >>>      done; \
  13 | >>>      if [ -d .dist ]; then \
  14 | >>>              GOARCH=$(go env GOARCH); \
  15 | >>>              BIN_DIR_SUFFIX=linux_$GOARCH; \
  16 | >>>              [ $GOARCH = "amd64" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_v1; \
  17 | >>>              [ $GOARCH = "arm" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_$(go env GOARM | cut -d , -f 1); \
  18 | >>>              cp .dist/gop_$BIN_DIR_SUFFIX/bin/gop .dist/gopfmt_$BIN_DIR_SUFFIX/bin/gopfmt $GOPROOT/bin/; \
  19 | >>>      else \
  20 | >>>              ./all.bash; \
  21 | >>>              cp bin/gop bin/gopfmt $GOPROOT/bin/; \
  22 | >>>      fi
  23 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c set -eux; \tmkdir -p $GOPROOT/bin; \tcp LICENSE *.mod *.sum *.md $GOPROOT/; \tfor PATTERN in \"*.go\" \"*.md\"; do \t\tfind . -mindepth 2 -name \"$PATTERN\" -exec cp --parents {} $GOPROOT/ \\;; \tdone; \tif [ -d .dist ]; then \t\tGOARCH=$(go env GOARCH); \t\tBIN_DIR_SUFFIX=linux_$GOARCH; \t\t[ $GOARCH = \"amd64\" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_v1; \t\t[ $GOARCH = \"arm\" ] && BIN_DIR_SUFFIX=${BIN_DIR_SUFFIX}_$(go env GOARM | cut -d , -f 1); \t\tcp .dist/gop_$BIN_DIR_SUFFIX/bin/gop .dist/gopfmt_$BIN_DIR_SUFFIX/bin/gopfmt $GOPROOT/bin/; \telse \t\t./all.bash; \t\tcp bin/gop bin/gopfmt $GOPROOT/bin/; \tfi" did not complete successfully: exit code: 1

Learn more at https://goreleaser.com/errors/docker-build

@aofei
Copy link
Member Author

aofei commented Mar 17, 2024

I can't verify this locally, the full logs are attached below, are there some steps I missing?

The error you're seeing is likely due to not having QEMU installed. QEMU is required for building Docker images for different architectures. https://goreleaser.com/cookbooks/multi-platform-docker-images/#other-things-to-pay-attention-to

@cpunion
Copy link
Contributor

cpunion commented Mar 18, 2024

The error you're seeing is likely due to not having QEMU installed. QEMU is required for building Docker images for different architectures. https://goreleaser.com/cookbooks/multi-platform-docker-images/#other-things-to-pay-attention-to

Thanks. Build pass in https://github.com/cpunion/gop/actions/runs/8319567514/job/22763054716 . I will test the images later.

@aofei
Copy link
Member Author

aofei commented Mar 18, 2024

Okay, that makes sense. Just a small issue, docker always have two different build steps.

I'm not sure but in case you're referring to multi-stage builds, the purpose is to ensure the final image is as clean and small as possible, which is a common practice.

In your github action link above (# 8) skiped docker build. But seems your build # 9 success.

Are you referring to this step? That's expected. All images are built, but for pre-releases, we only push the full-version image tag. To break it down, for a stable release like v1.2.3, we push 4 image tags: v1.2.3, v1.2, v1, and latest. But for a pre-release like v1.2.3-beta.1, we must only push 1 image tag: v1.2.3-beta.1.

Dockerfile Outdated Show resolved Hide resolved
@cpunion
Copy link
Contributor

cpunion commented Mar 18, 2024

Okay, that makes sense. Just a small issue, docker always have two different build steps.

I'm not sure but in case you're referring to multi-stage builds, the purpose is to ensure the final image is as clean and small as possible, which is a common practice.

Oops, my mistake. I meant the Dockerfile has two branches that run different code depending on the built files. And docker build meant build from the latest code, but it might not always yield the expected results for users, it's not just used in CI.

In your github action link above (# 8) skiped docker build. But seems your build # 9 success.

Are you referring to this step? That's expected. All images are built, but for pre-releases, we only push the full-version image tag. To break it down, for a stable release like v1.2.3, we push 4 image tags: v1.2.3, v1.2, v1, and latest. But for a pre-release like v1.2.3-beta.1, we must only push 1 image tag: v1.2.3-beta.1.

OK.

@aofei
Copy link
Member Author

aofei commented Mar 18, 2024

I meant the Dockerfile has two branches that run different code depending on the built files

That's a good catch. The build flow is currently determined by the presence of the .dist directory, which could indeed lead to a scenario where users unknowingly use an outdated .dist. If this is a concern, perhaps we could control it using a build arg, such as USE_GORELEASER_ARTIFACTS. Thoughts?

@cpunion
Copy link
Contributor

cpunion commented Mar 18, 2024

I meant the Dockerfile has two branches that run different code depending on the built files

That's a good catch. The build flow is currently determined by the presence of the .dist directory, which could indeed lead to a scenario where users unknowingly use an outdated .dist. If this is a concern, perhaps we could control it using a build arg, such as USE_GORELEASER_ARTIFACTS. Thoughts?

I think it's better for using explicit flags.

@aofei
Copy link
Member Author

aofei commented Mar 18, 2024

I've just made changes to the PR as discussed, and it's ready for review now.

@aofei aofei requested a review from cpunion March 18, 2024 08:00
Copy link
Contributor

@cpunion cpunion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve.

@xushiwei xushiwei merged commit 94b6b9f into goplus:main Mar 18, 2024
15 checks passed
@aofei aofei deleted the dockerimage branch March 18, 2024 10:08
@aofei aofei restored the dockerimage branch March 18, 2024 10:08
@aofei aofei deleted the dockerimage branch March 18, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal for official Docker image support for Go+
3 participants