https://pantsbuild.org/ logo
#general
Title
# general
j

jolly-kite-53356

04/02/2023, 2:53 AM
Hi all, I’m really excited to see the new features in 2.15. 🎉. Some questions for the multi-platform support. I’m on a M1 laptop, I’m trying to figure out if/how to build docker image for linux/amd64 platform. I’ve tried with adding
platforms=["anylinux2014_x86_64-cp-310-cp310"]
to pex or use the new
Copy code
docker_environment(
    name="python_bullseye",
    platform="linux_x86_64",
    image="python:3.10.9-slim-bullseye",
    python_bootstrap_search_path=["<PATH>"],
)
but it seems like the docker image it built still in arm architecture. Could someone help me to figure this out?
b

broad-processor-92400

04/02/2023, 3:06 AM
Are you trying to build a
docker_image
target specifically? If so, https://github.com/pantsbuild/pants/issues/17539 is relevant. I put a potential work around in a comment there: setting the following in `pants.toml`:
Copy code
[docker]
env_vars.add = [
    "DOCKER_DEFAULT_PLATFORM=linux/amd64"
]
(NB. that'll force all docker images to be
linux/amd64
.)
j

jolly-kite-53356

04/02/2023, 5:24 AM
Yes! It’ll be great to see this coming! 🙏
2 Views