Hello, I am using Docker storage to store my flows...
# ask-community
e
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
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
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
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
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
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
@Marvin archive “DockerStorage not running on different (architecture x86 vs M1)”