I have a line in a dockerfile to set the container's environment variable based on the output of an npm
script:
ENV BUILD_VERSION=$(npm pkg get version | sed 's/"//g')
running npm pkg get version | sed 's/"//g'
in my terminal outputs:
❯ npm pkg get version | sed 's/"//g'
4.12.3
But, in the dockerfile I get this error when building:
failed to solve with frontend dockerfile.v0: failed to create LLB definition: Syntax error - can't find = in "pkg". Must be of the form: name=value