Thread
#prefect-community
    Erik Amundson

    Erik Amundson

    1 year ago
    Hello, I am using Docker storage to store my flows, but I'm on an ARM mac and our production environment is x86. From the command line I can build the docker image for the correct architecture using
    docker buildx build --platform linux/amd64
    . Is there any way to do this in the
    prefect.storage.docker.Docker
    class or can I build the image locally first then add flows to a pre-built image?
    nicholas

    nicholas

    1 year ago
    Hi @Erik Amundson - I believe you should be able to pass the platform type as an extra
    build_kwarg
    to the storage class
    So something like:
    Docker(
      ...
      build_kwargs=dict(platform='linux/amd64')
    )
    Erik Amundson

    Erik Amundson

    1 year ago
    That doesn't seem to change anything, I'm still getting the error
    failed to get destination image "xxx": image with reference xxx was found but does not match the specified platform: wanted linux/amd64, actual: linux/arm64
    I think
    docker buildx
    is separate from
    docker build
    so
    docker build
    doesn't recognize the kwarg
    platform
    nicholas

    nicholas

    1 year ago
    Ah in which case I don't think so; I could be wrong but I don't think the docker-py sdk supports the new docker build kit, there's an issue open for it here
    Let me see if there's another way to handle this like you suggested
    Kevin Kho

    Kevin Kho

    1 year ago
    I think the platform here should support it on the build side, but the problem is you might need to specify the platform on the
    pull/run
    side per this, but py-docker doesn’t have this exposed on
    create_container
    per this .
    Erik Amundson

    Erik Amundson

    1 year ago
    Ah I see, I tried pulling the python-3.8 (our base image) for linux/amd64 image before running the register script and that seems to be working, thank you!
    Kevin Kho

    Kevin Kho

    1 year ago
    @Marvin archive “DockerStorage not running on different (architecture x86 vs M1)”
    Marvin

    Marvin

    1 year ago