1

I'm using in docker-compose entrypoint two commands:

entrypoint: ["curl", "-X", "working command","&&","npm", "working command"]

When I'm using them separately they are working, but when I used provided solution it looks curl catch npm command and it can't be executed in a proper way. So how to split them? Is there any solution without using bash script, like

entrypoint: ["./script.sh","&&","npm", "working command"]
B.ant
  • 131
  • 2
  • 8

1 Answers1

3

This should work:

 entrypoint: ["/bin/sh", "-c", "curl -X working_command && npm working_command"]

For example printcurl output and npm version:

 entrypoint: ["/bin/sh", "-c", "curl https://stackoverflow.com && npm --version"]

In alternative use both entrypoint and command:

entrypoint: /bin/sh
command: -c "curl -X working_command && npm working_command"

or simply:

entrypoint: /bin/sh -c "curl https://stackoverflow.com && npm --version"
b0gusb
  • 4,283
  • 2
  • 14
  • 33