Variable interpolation in CMD
See original GitHub issueDescribe the bug
Running a CMD
with a command that uses an environment variable does not interpolate it.
In package.json
:
"scripts": {
"storybook": "start-storybook -p ${STORYBOOK_PORT:-9001}",
}
In Dockerfile
:
ENV STORYBOOK_PORT=300
CMD [ "/bin/sh", "-c", "npm run storybook" ]
OR
ENV STORYBOOK_PORT=3000
CMD [ "/bin/sh", "-c", "npm", "run", "storybook" ]
Results in $STORYBOOK_PORT
always be an empty string.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Batch Script - String Interpolation - Tutorialspoint
String interpolation is a way to construct a new String value from a mix of constants, variables, literals, and expressions by including their...
Read more >Windows Batch Files - Interpolate environment variables into ...
In Batch SET command the variable name is the complete string before the equal sign (including spaces) and the variable value is the ......
Read more >Batch Script - String Interpolation - GeeksforGeeks
String interpolation is a technical way of saying parsing a value that might be a variable into a string. It is an important...
Read more >Shell Command Substitution – interpolate stdout into a ...
You can use command substitution to interpolate text anywhere that you might use a shell variable. Command substitution is especially useful in shell...
Read more >Environment variables in Compose | Docker Documentation
How to set, use and manage environment variables in Compose. ... a path to your environment variables file using the --env-file command line...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@alexdesignworks You can just change the CMD:
and then it’s running is
bash
plus the reason to now use bash by default is that bash is not by default in the alpine upstream images and we want to keep the images as small and as upstreamy as possible.