[FEATURE] Ability to pass in `--platform` for docker client while creating clusters/nodes
Author: cenk1cenk2Created Aug 18, 2025Updated Jun 15, 2026
Labelsenhancement
Is your feature request related to a problem or a Pull Request
Please link to the issue/PR here and explain how your request is related to it.
- https://github.com/k3d-io/k3d/discussions/1031 -> This has been raised here as a discussion but workarounds are proposed.
Scope of your request
- a new flag for a command
- proposing a
--platformargument here for commandscluster createandnode create
- proposing a
- config entry
- proposing a config entry as follows
options: platforms: - platform: linux/arm64/v8 nodeFilters: - server:* - agent:*
- proposing a config entry as follows
Describe the solution you'd like
Currently k3d can not create an emulated environment in linux/amd64 environment for linux/arm64/v8 or similar since in https://github.com/k3d-io/k3d/blob/main/pkg/runtimes/docker/container.go#L54-L54, containers are created without the ocispecv1.Platform as nil. The docker go client does not directly support DOCKER_DEFAULT_PLATFORM environment variable to set this automatically like the CLI.
- I would propose to implement a flag called
--platformwhere this gets passed intocluster createandnode createcommands, where the user can set a platform for the created cluster or node. - This can be also added to the config file under
options.runtime.platform. This should be also relevant to the master and worker nodes as well asloadbalancerandtoolcontainers. However anodeFiltersmechanism can be implemented here, like thelabelsto make this more configurable.
Describe alternatives you've considered
- Pulling and running the images with the designated architecture like
rancher/k3s:v1.32.7-k3s1-arm64does not work properly.
Notes
I can implement this as a contribution; however, I am not sure if this would be an appropriate merge request for the repository and would be accepted. Therefore, I am opening up an issue first to get your input on it.
Source: k3d-io/k3d