Skip to content

when building a non-Dockerfile x86 image on apple silicon (M1, M2, M2 Pro),repo2docker fails on mamba env update #1352

Open
@shaneknapp

Description

@shaneknapp

Bug description

repo2docker fails when a non-Dockerfile build hits the following step:

Step 40/53 : RUN TIMEFORMAT='time: %3R' bash -c 'time ${MAMBA_EXE} env update -p ${NB_PYTHON_PREFIX} --file "environment.yml" && time ${MAMBA_EXE} clean --all -f -y && ${MAMBA_EXE} list -p ${NB_PYTHON_PREFIX} '
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
 ---> Running in 35f6725e11e1

CondaError: Error encountered while attempting to create cache directory.
  Directory: /home/sknapp/.cache/conda/notices
  Exception: [Errno 13] Permission denied: '/home/sknapp/.cache/conda'

time: 0.407

the commands i tried were:

  1. repo2docker --user-id 501 --no-run --Repo2Docker.platform=linux/amd64 --Repo2Docker.base_image=docker.io/library/buildpack-deps:jammy .
  2. repo2docker --no-run --Repo2Docker.platform=linux/amd64 --Repo2Docker.base_image=docker.io/library/buildpack-deps:jammy .
  3. repo2docker --user-id 1000 --no-run --Repo2Docker.platform=linux/amd64 --Repo2Docker.base_image=docker.io/library/buildpack-deps:jammy .

the image that failed to build: https://github.com/berkeley-dsep-infra/datahub/tree/staging/deployments/data100/image

however, if you build an image that's based on a Dockerfile, you're good to go! you can try yourself with this image: https://github.com/berkeley-dsep-infra/datahub/tree/staging/deployments/dev/images/default

it appears that repo2docker might not be inheriting or passing on the correct permissions to allow writing to the local filesystem during the mamba env update step.

Expected behaviour

i would expect mamba to be able to update the conda env. :)

Actual behaviour

it fails.

How to reproduce

  1. get a mac w/an M chip, and run repo2docker --user-id 1000 --no-run --Repo2Docker.platform=linux/amd64 --Repo2Docker.base_image=docker.io/library/buildpack-deps:jammy . on an image dir that doesn't have a Dockerfile
  2. fail!

Your personal set up

  • OS: OSX sonoma
  • Docker version: 26.1.1
  • repo2docker version: 2024.03.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions