I want to run source in docker-compose command
, like
command: ["source", "/etc/profile", ";", "/usr/local/tomcat/bin/catalina.sh", "run"]
the error is
ERROR: for pica-cat3 Cannot start service pica-cat3: b'OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \\"source\\": executable file not found in $PATH": unknown'
what can I do?
Best Answer
Use the builtin command from the shell which is embedded in your execution environment.
If
/bin/sh
, then run command/bin/sh -c '. /etc/profile ; /usr/local/tomcat/bin/catalina.sh run
If
/bin/bash
, then run command/bin/bash -c '. /etc/profile ; /usr/local/tomcat/bin/catalina.sh run
If
/bin/csh
, then run command/bin/csh -c 'source /etc/profile ; /usr/local/tomcat/bin/catalina.sh run