ldez / seihon

A simple tool to build and publish multi-arch images on the Docker Hub.
Other
21 stars 1 forks source link

Building on M1 fails #14

Closed andig closed 3 years ago

andig commented 3 years ago
❯ make publish-testing
Version: 0.48 2021-03-01_12:05:14
seihon publish --dry-run=false --template docker/tmpl.Dockerfile --base-runtime-image alpine:3.13 \
       --image-name andig/evcc -v "testing" --targets=arm.v6,amd64
#2 [internal] load .dockerignore
#2 sha256:45970a5ba3692230271af3bb2930e86b07e528c14d3cfd9daca236570343fa81
#2 transferring context: 35B done
#2 ...

#1 [internal] load build definition from linux-amd64-.Dockerfile
#1 sha256:1a26ecc04159d8e1235da3cff787794100a4030ea97fd1e4cb1fcc29e8cf5d06
#1 transferring dockerfile: 1.52kB 0.0s done
#1 DONE 0.4s

#2 [internal] load .dockerignore
#2 sha256:45970a5ba3692230271af3bb2930e86b07e528c14d3cfd9daca236570343fa81
#2 DONE 0.5s

#3 [internal] load metadata for docker.io/library/alpine:3.13@sha256:ddba4d27a7ffc3f86dd6c2f92041af252a1f23a8e742c90e6e1297bfa1bc0c45
#3 sha256:c15a9766abcdd338bb7a7e81437a20374d5ad542c550aa7e659c4a633c50cf06
#3 DONE 0.2s

#4 [internal] load metadata for docker.io/library/node:14-alpine
#4 sha256:e9f604fd3f1f0040236326aac32cfcef9c63fae57a1934aceea4decb8d14451f
#4 ERROR: failed to authorize: rpc error: code = Unavailable desc = transport is closing

#5 [internal] load metadata for docker.io/library/golang:1.16-alpine
#5 sha256:066c23f588b92c8811e28ac05785cd295f354b1e7f60b3e42c4008ec173536c2
#5 ERROR: failed to authorize: rpc error: code = Unavailable desc = transport is closing
------
 > [internal] load metadata for docker.io/library/node:14-alpine:
------
------
 > [internal] load metadata for docker.io/library/golang:1.16-alpine:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to authorize: rpc error: code = Unavailable desc = transport is closing

Error: failed to build: /usr/local/bin/docker build -t andig/evcc:testing-amd64 -f linux-amd64-.Dockerfile .: exit status 1
Usage:
  seihon publish [flags]

Flags:
  -b, --base-runtime-image string   Base Docker image. (default "alpine:3.13")
      --dry-run                     Dry run mode. (default true)
  -h, --help                        help for publish
  -i, --image-name string           Image name (user/repo)
      --targets strings             Targeted architectures. (default [arm.v6,arm.v7,arm.v8,amd64,386])
      --template string             Dockerfile template (default "./tmpl.Dockerfile")
  -v, --versions strings            Image version.

failed to build: /usr/local/bin/docker build -t andig/evcc:testing-amd64 -f linux-amd64-.Dockerfile .: exit status 1
make: *** [publish-testing] Error 1

I could solve this my pulling the "failed" images upfront. Not sure is even related to seihon, I'm running on pre-release Docker 3.1.0 darwin/arm64.

ldez commented 3 years ago

Could you try with v0.8.0?

ldez commented 3 years ago

Because of a release bug, the v0.8.0 doesn't exist #15

Could you try with v0.8.2?

andig commented 3 years ago

Wish I could:

SkyNetM1:htdocs andig$ brew tap ldez/tap
==> Tapping ldez/tap
Cloning into '/opt/homebrew/Library/Taps/ldez/homebrew-tap'...
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 201 (delta 2), reused 0 (delta 0), pack-reused 193
Receiving objects: 100% (201/201), 28.62 KiB | 2.38 MiB/s, done.
Resolving deltas: 100% (85/85), done.
Error: Invalid formula: /opt/homebrew/Library/Taps/ldez/homebrew-tap/Formula/seihon.rb
formulae require at least a URL
Error: Cannot tap ldez/tap: invalid syntax in tap!

Not sure what's up here:

SkyNetM1:htdocs andig$ uname -p
arm
ldez commented 3 years ago

You can use the binary :wink:

andig commented 3 years ago

I'll build from source, but for completeness:

❯ curl -sfL https://raw.githubusercontent.com/ldez/seihon/master/godownloader.sh | bash -s -- -b $GOPATH/bin
ldez/seihon crit platform darwin/arm64 is not supported.  Make sure this script is up-to-date and file request at https://github.com/ldez/seihon/issues/new
ldez commented 3 years ago

v0.8.3 will add the binary and the brew support

andig commented 3 years ago

I'll just wait, no hurry:

❯ go install github.com/ldez/seihon@latest

~/htdocs
❯ seihon -v
seihon version 0.7.1

❯ go install github.com/ldez/seihon@0.8.2
Alias tip: goi github.com/ldez/seihon@0.8.2
go install github.com/ldez/seihon@0.8.2: github.com/ldez/seihon@0.8.2: invalid version: unknown revision 0.8.2

I would have expected go install to get latest commit and build for arm...

ldez commented 3 years ago

v0.8.2 instead of 0.8.2

ldez commented 3 years ago

the v0.8.3 is available on my brew tap

andig commented 3 years ago

LGTM! Wiped the docker disk (i.e. the image cache) and started build which worked.