Reputation: 132
In my CI build, I'd like to print a formatted string which is built from some nested commands by Docker like:
docker run -t --rm -v /mysrc:/src -w /src node:lts echo "My project uses `npm list aLibrary`"
On bash, the command echo "My project uses `npm list aLibrary`"
just runs perfectly, but when passing to Docker, neither backtick`
nor $()
can be interpolated.
Anyone could help?
I've thought about making a .sh
file to mount into the docker container, but a file would need a place to be stored, I think this simple CI script shouldn't be in a file.
Upvotes: 1
Views: 1447
Reputation: 18578
this will work :
echo "My project uses `/usr/local/bin/npm list aLibrary`"
you need to supply the full path
Upvotes: 2