Compile Docker on ARM mac

I’m looking to add the earthengine-api via pip in the .yml files. I’ve gone through all the setup steps, but get this error when attempting to “make build” the base Docker image (with NO package updates; just the current approved requirements yml’s):

(p310) daviddralle@macbook-air-166 water-supply-forecast-rodeo-runtime % make build

docker build \

		--build-arg CPU_OR_GPU=cpu \

		-t watersupply-competition:cpu-local \

		--file runtime/Dockerfile \

		.

[+] Building 2.0s (14/18)                                                                              docker:desktop-linux

 => [internal] load build definition from Dockerfile                                                                   0.0s

 => => transferring dockerfile: 1.12kB                                                                                 0.0s

 => [internal] load .dockerignore                                                                                      0.0s

 => => transferring context: 138B                                                                                      0.0s

 => [internal] load metadata for docker.io/mambaorg/micromamba:bookworm-slim                                           0.8s

 => [auth] mambaorg/micromamba:pull token for registry-1.docker.io                                                     0.0s

 => [ 1/13] FROM docker.io/mambaorg/micromamba:bookworm-slim@sha256:e296d47be09fc5d260eba9b191f60496f028a4f3ec41e8a14  0.0s

 => [internal] load build context                                                                                      0.0s

 => => transferring context: 127.92kB                                                                                  0.0s

 => CACHED [ 2/13] COPY runtime/apt.txt apt.txt                                                                        0.0s

 => CACHED [ 3/13] RUN apt-get update --fix-missing     && apt-get install -y apt-utils 2> /dev/null     && xargs -a   0.0s

 => [ 4/13] COPY --chown=mambauser:mambauser runtime/conda-lock-cpu.yml /tmp/conda-lock.yml                            0.0s

 => [ 5/13] RUN micromamba install --name base --yes --file /tmp/conda-lock.yml &&     micromamba clean --all --force  0.4s

 => [ 6/13] RUN mkdir -p /code_execution/predictions                                                                   0.2s

 => [ 7/13] RUN chown -R mambauser:mambauser /code_execution                                                           0.3s 

 => [ 8/13] COPY data_reading /data_reading                                                                            0.0s

 => ERROR [ 9/13] RUN pip install /data_reading --no-cache-dir --no-deps                                               0.2s

------                                                                                                                      

 > [ 9/13] RUN pip install /data_reading --no-cache-dir --no-deps:

0.202 bash: line 1: pip: command not found

------

Dockerfile:29

--------------------

  27 |     

  28 |     COPY data_reading /data_reading

  29 | >>> RUN pip install /data_reading --no-cache-dir --no-deps

  30 |     

  31 |     COPY runtime/entrypoint.sh /entrypoint.sh

--------------------

ERROR: failed to solve: process "/usr/local/bin/_dockerfile_shell.sh pip install /data_reading --no-cache-dir --no-deps" did not complete successfully: exit code: 127

Does this happen because I have the ARM mac? I get this warning when I run “make test-container”:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Thanks for any info on this.

David

Hi @daviddralle,

We were able to reproduce your error, and it seems to indeed be specific to using an Apple Silicon/ARM Mac.

As a quick workaround, I believe setting an environment variable DOCKER_DEFAULT_PLATFORM=linux/amd64 before running make build should fix the issue.

We’re working on a fix in the repo that will make this setting directly in the Dockerfile so that the environment variable won’t be required.