Skip to content

Arch in dockerfile#503

Merged
AkihiroSuda merged 1 commit intorootless-containers:masterfrom
AlexeyPerevalov:arch_in_dockerfile
Apr 21, 2025
Merged

Arch in dockerfile#503
AkihiroSuda merged 1 commit intorootless-containers:masterfrom
AlexeyPerevalov:arch_in_dockerfile

Conversation

@AlexeyPerevalov
Copy link
Copy Markdown

This PR adds parameter into Dockerfile for ISA of binaries used during image build.

The default value is x86_64 as before.
This PR tested with aarch64, and it could be specified by --build-arg ARCH=aarch64 options of docker build command.

Dockerfile Outdated
ARG DOCKER_VERSION=28.0.1
ARG DOCKER_CHANNEL=stable
# also tested with aarch64
ARG ARCH=x86_64
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use TARGETARCH to support docker build --platform

https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe just checking $(uname -m) may suffice, then no need to use ARG

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/ all variables such as TARGETARCH, TARGETPLATFORM from --platform are filled with arm64,
it's strange but all url, like https://download.docker.com/linux/static/stable/linux/aarch64/docker-27.5.0.tgz contain aarch64, not arm64.
I think $(uname -m) is enough, to not spread variables.

@AkihiroSuda AkihiroSuda added this to the v2.3.5 milestone Apr 12, 2025
@AkihiroSuda
Copy link
Copy Markdown
Member

Please squash the commits

To run it in Ubuntu VM on MAC Mx, taishan/kunpeng, thunder x servers.

Signed-off-by: Alexey Perevalov <alexperevalov@yandex-team.ru>
Copy link
Copy Markdown
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit 9f37a39 into rootless-containers:master Apr 21, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants