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

docker build fails on macOS + colima #3370

Open
Amar1729 opened this issue May 5, 2024 · 0 comments
Open

docker build fails on macOS + colima #3370

Amar1729 opened this issue May 5, 2024 · 0 comments

Comments

@Amar1729
Copy link

Amar1729 commented May 5, 2024

Background information

  • Dendrite version or git SHA: v0.13.7
  • SQLite3 or Postgres?: n/a
  • Running in Docker?: yes
    • docker --version: Docker version 26.1.1, build 4cf5afaefa
    • colima --version: colima version 0.6.8
  • go version: n/a
  • Client used (if applicable): n/a

Description

  • What is the problem: docker build fails on m1 (arm64) mac mini while using colima as a provider
  • Who is affected: users trying to serve dendrite from an arm Mac
  • How is this bug manifesting: (see steps to repro)
  • When did this first appear:

Steps to reproduce

~/Documents/matrix/dendrite $ colima version
colima version 0.6.8
git commit: 9b0809d0ed9ad3ff1e57c405f27324e6298ca04f

runtime: docker
arch: aarch64
client: v26.1.1
server: v24.0.9

~/Documents/matrix/dendrite $ docker build -t matrixdotorg/dendrite-monolith .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  64.91MB
Step 1/23 : FROM --platform=${BUILDPLATFORM} docker.io/golang:1.21-alpine3.18 AS base
failed to parse platform : "" is an invalid component of "": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument

However, there's a workaround: ssh into colima's VM, and then issue docker build from there.

$ colima ssh
amar@colima:/Users/amar/Documents/matrix/dendrite$ docker build -t matrixdotorg/dendrite-monolith .

<builds as expected>

I have deleted + re-initialized the colima VM to ensure i was building from a clean slate. I think that this actually might be some kind of an issue with how colima is setting certain variables, or communicating with the docker client. Since I figured out a workaround, i thought I would post it here in case anybody runs into the same issue (but I'm not yet sure why exactly this is happening?).

I did try docker build with --platform arm64 (and others) based on the error message, but that didn't result in anything different.

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

No branches or pull requests

1 participant