I am attempting to add this to export in my profile
export CLI ='docker-compose exec cardano-node sh -c "CARDANO_NODE_SOCKET_PATH=/ipc/node.socket cardano-cli"'
This command works with no issue from the command line docker-compose exec cardano-node sh -c "CARDANO_NODE_SOCKET_PATH=/ipc/node.socket cardano-cli"
I tried it placing it in quote a number of ways and I keep getting the following error
cardano-cli": -c: line 0: unexpected EOF while looking for matching `"' cardano-cli": -c: line 1: syntax error: unexpected end of file
What's the deal here?
docker-compose exec
takes a-e
option to set environment variables. If you use that option, you don't need thesh -c
wrapper, since you are just running a simple command, and this removes a layer of quotes.docker-compose exec
will also get the environment variables from thedocker-compose.yml
file, so if you declare the variables thereyou don't have to repeat them in
docker-compose exec
at all