Below commands in (tried in zsh and bash)
» docker build --label $(echo -n 'key="name value"') .
"docker build" requires exactly 1 argument.
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
but if you try to check the actual command
» echo docker build --label $(echo -n 'key="name value"') .
docker build --label key="name value" .
and then run it, it works. What am I missing
» docker build --label key="name value" .
Sending build context to Docker daemon 4.096kB
Step 1/2 : from busybox
---> 3a093384ac30
Step 2/2 : LABEL key=name value
---> Using cache
---> 8e0f5a40215e
Successfully built 8e0f5a40215e