nerdctl icon indicating copy to clipboard operation
nerdctl copied to clipboard

Allow default platform to be specified with NERDCTL_DEFAULT_PLATFORM / DOCKER_DEFAULT_PLATFORM

Open johnklehm opened this issue 3 years ago • 4 comments

What is the problem you're trying to solve

I want to run x86 containers on macOS aarm64. Im faced with setting platform: linux/amd64 in all my compose files and passing --platform x86_64 on all my command line invocations. It'd be nice to set this in an env var in my profile or in a config file (probably the option for either is nice).

Describe the solution you'd like

docker supports this with the DOCKER_DEFAULT_PLATFORM env var....could support that directly or simply have a dedicated nerdctl version: NERDCTL_DEFAULT_PLATFORM.

Additional context

No response

johnklehm avatar Jun 21 '22 18:06 johnklehm

I guess we should extend https://github.com/containerd/nerdctl/blob/master/docs/config.md to support specifying the default nerdctl run template and the nerdctl build template

AkihiroSuda avatar Jun 21 '22 18:06 AkihiroSuda

I guess we should extend https://github.com/containerd/nerdctl/blob/master/docs/config.md to support specifying the default nerdctl run template and the nerdctl build template

I think this is making sense

How about this?

[default-run-config]
network="xxx"
[default-build-config]
platform="xxx"

I think to exposure network and platform filed maybe is enough for now.

Zheaoli avatar Jun 22 '22 08:06 Zheaoli

Hi @AkihiroSuda @Zheaoli , I‘d like to have a try, can you assign this to me?

YangKian avatar Jul 01 '22 07:07 YangKian

Hi @AkihiroSuda @Zheaoli , I‘d like to have a try, can you assign this to me?

Of course

Zheaoli avatar Jul 01 '22 07:07 Zheaoli