https://prefect.io logo
e

Erik Amundson

07/15/2021, 10:06 PM
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?
n

nicholas

07/15/2021, 10:11 PM
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:
Copy code
Docker(
  ...
  build_kwargs=dict(platform='linux/amd64')
)
đź‘Ť 1
e

Erik Amundson

07/15/2021, 10:17 PM
That doesn't seem to change anything, I'm still getting the error
Copy code
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
n

nicholas

07/15/2021, 10:22 PM
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
k

Kevin Kho

07/15/2021, 10:27 PM
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 .
e

Erik Amundson

07/15/2021, 10:34 PM
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!
k

Kevin Kho

08/30/2021, 8:54 PM
@Marvin archive “DockerStorage not running on different (architecture x86 vs M1)”
8 Views