如何从 compose 入口点拆分 curl 和 npm 命令
How to split curl and npm command from compose entrypoint
我在 docker-compose 入口点中使用两个命令:
entrypoint: ["curl", "-X", "working command","&&","npm", "working command"]
当我单独使用它们时,它们可以正常工作,但是当我使用提供的解决方案时,它看起来像 curl catch npm 命令,并且无法以正确的方式执行。那么如何拆分它们呢?
有没有不使用 bash 脚本的解决方案,比如
entrypoint: ["./script.sh","&&","npm", "working command"]
这应该有效:
entrypoint: ["/bin/sh", "-c", "curl -X working_command && npm working_command"]
例如打印curl
输出和npm
版本:
entrypoint: ["/bin/sh", "-c", "curl https://whosebug.com && npm --version"]
或者同时使用入口点和命令:
entrypoint: /bin/sh
command: -c "curl -X working_command && npm working_command"
或简单地:
entrypoint: /bin/sh -c "curl https://whosebug.com && npm --version"
我在 docker-compose 入口点中使用两个命令:
entrypoint: ["curl", "-X", "working command","&&","npm", "working command"]
当我单独使用它们时,它们可以正常工作,但是当我使用提供的解决方案时,它看起来像 curl catch npm 命令,并且无法以正确的方式执行。那么如何拆分它们呢? 有没有不使用 bash 脚本的解决方案,比如
entrypoint: ["./script.sh","&&","npm", "working command"]
这应该有效:
entrypoint: ["/bin/sh", "-c", "curl -X working_command && npm working_command"]
例如打印curl
输出和npm
版本:
entrypoint: ["/bin/sh", "-c", "curl https://whosebug.com && npm --version"]
或者同时使用入口点和命令:
entrypoint: /bin/sh
command: -c "curl -X working_command && npm working_command"
或简单地:
entrypoint: /bin/sh -c "curl https://whosebug.com && npm --version"