OpenFn / OpenFn/lightning

Get buildx with linux/amd64 platform working on M1s

Open
#119 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Elixir
Stars
296
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
50

Description

Right now running docker buildx build --platform linux/amd64 -t lightning_web:latest . on ARM (Apple Silicon M1) crashes out at step 7/23:

[+] Building 175.3s (20/38)                                                                                                                          
 => [internal] load build definition from Dockerfile                                                                                            0.0s
 => => transferring dockerfile: 3.10kB                                                                                                          0.0s
 => [internal] load .dockerignore                                                                                                               0.0s
 => => transferring context: 35B                                                                                                                0.0s
 => [internal] load metadata for docker.io/library/debian:bullseye-20210902-slim                                                                1.4s
 => [internal] load metadata for docker.io/hexpm/elixir:1.13.1-erlang-24.2.1-debian-bullseye-20210902-slim                                      1.4s
 => CACHED [builder  1/23] FROM docker.io/hexpm/elixir:1.13.1-erlang-24.2.1-debian-bullseye-20210902-slim@sha256:c3742773ba05f2f3ffb9bdf946252  0.0s
 => [internal] load build context                                                                                                               0.1s
 => => transferring context: 712.60kB                                                                                                           0.1s
 => CACHED [stage-1  1/10] FROM docker.io/library/debian:bullseye-20210902-slim@sha256:e3ed4be20c22a1358020358331d177aa2860632f25b21681d79204a  0.0s
 => [builder  2/23] RUN apt-get update -y && apt-get install -y   build-essential curl git inotify-tools                                      125.0s
 => [stage-1  2/10] RUN apt-get update -y && apt-get install -y libstdc++6 openssl libncurses5   locales curl                                  60.6s
 => [stage-1  3/10] RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -                                                              47.0s
 => [stage-1  4/10] RUN apt-get install -y nodejs                                                                                              14.9s
 => [stage-1  5/10] RUN apt-get clean && rm -f /var/lib/apt/lists/*_**                                                                          0.4s
 => [stage-1  6/10] RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen                                                            8.0s
 => [builder  3/23] RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -                                                              33.4s
 => [stage-1  7/10] WORKDIR /app                                                                                                                0.0s
 => [stage-1  8/10] RUN chown nobody /app                                                                                                       0.2s
 => [builder  4/23] RUN apt-get install -y nodejs                                                                                              14.5s 
 => [builder  5/23] RUN apt-get clean && rm -f /var/lib/apt/lists/*_*                                                                           0.3s 
 => [builder  6/23] WORKDIR /app                                                                                                                0.0s 
 => ERROR [builder  7/23] RUN mix local.hex --force &&   mix local.rebar --force                                                                0.6s 
------                                                                                                                                               
 > [builder  7/23] RUN mix local.hex --force &&   mix local.rebar --force:                                                                           
#0 0.628 qemu: uncaught target signal 11 (Segmentation fault) - core dumped                                                                          
#0 0.638 Segmentation fault
------
error: failed to solve: executor failed running [/bin/sh -c mix local.hex --force &&   mix local.rebar --force]: exit code: 139

Some more reports: https://github.com/docker/for-mac/issues/6075

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the repository's Dockerfile and reproduce docker buildx build --platform linux/amd64 on an Apple Silicon host. Inspect the failing mix local.hex --force && mix local.rebar --force step and compare the failure with Docker for Mac issue 6075. Done means the documented build completes successfully for the requested platform, or the issue is narrowed to an external dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, elixir
Domain
build-system, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.