hi all, I have a question regarding kedro docker. ...
# questions
j
hi all, I have a question regarding kedro docker. how can I build an image for a different platform? I have a mac, and for aws ECS I need to build the image with a different architecture. I use this command to build the images directly with docker:
docker buildx build --platform=linux/amd64 -t <image-name> .
Is there a ‘kedro docker’ way of doing this? thanks!
f
I had the same issue and I think I looked up the
kedro docker
cli command some time back. Anyway this is how I have build some recent images on my mac:
docker buildx build --build-arg BASE_IMAGE=python:3.10-bullseye -t some-tag:latest /path/to/project/root --platform linux/amd64
👍 1
(after running
kedro docker init
)
d
You can pass
--docker-args '--platform=linux/amd64'
I believe (or more arguments) to `kedro docker build`; however, that won't use
buildx
. If you want to enable
buildx
, that would have to be a feature request to Kedro-Docker, or it's perfectly fine to build it outside of Kedro-Docker (I'm honestly not sure the extent to which Kedro-Docker should wrap everything you can do with Docker, even as far as builds go).
j
@Deepyaman Datta awesome!
--docker-args '--platform=linux/amd64'
this did the trick. just in case someone is interested, here is what I do. I develop with kedro on a mac, and I deploy on aws. I use cdk to create all the aws resources. when I have the pipeline ready, I run
kedro docker init
I do some changes in the DockerFile, not a big deal. and then I build two images: for the mac
kedro docker build --image image-name
for ecs
kedro docker build --docker-args '--platform=linux/amd64' --image image-name-amd64
I test locally with the mac image, and when everything works, I push the amd64 image to ECR. thank you very much!
🙌 1