0

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?

lily
  • 165
  • 1
  • 7

1 Answers1

1

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

Chaoxiang N
  • 1,218
  • 4
  • 10