Docker container build works locally, but not on Ubuntu runner. Fails on building uwsgi

We have a Dockerfile that starts

# syntax=docker/dockerfile:1.3

FROM python:3.10.5-bullseye as compile

# Get rustup https://rustup.rs/ for canonicaljson-rs
# minimal profile https://rust-lang.github.io/rustup/concepts/profiles.html
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile minimal -y
ENV PATH="/root/.cargo/bin:$PATH"

RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

RUN python -m pip install --upgrade pip
COPY requirements.txt .
RUN python -m pip install --no-cache-dir -r requirements.txt
...

one of of the requirements in requirements.txt being uwsgi==2.0.20.

We are able to build this docker container locally (on an Intel Mac) no problem.

But when trying to build the container in our pipeline:

  build_containers:
    machine:
      image: ubuntu-2004:2022.04.2
      docker_layer_caching: true
    environment:
      DOCKER_BUILDKIT: 1
      COMPOSE_DOCKER_CLI_BUILD: 1
      BUILDKIT_PROGRESS: plain
    steps:
      - checkout
      - run:
          name: Build
          command: docker-compose build
...

the build fails when trying to build uwsgi (pastebin of error).

Any ideas here? I thought the promise of Docker was that it was supposed to fix “works on my machine” :sob: .