如何使用容器外部的脚本在 docker 中执行 运行 命令

how to run command in docker using a script outside thecontainer

在我的 .mk 文件中,我做了如下操作

.PHONY : Test
Test:
  @echo Starting Docker container
  docker container start XXX;
  docker exec -it -w /home/TA/G/T/P XXX bash
  docker exec /home/CO/CO_ANAlysis/bin/c-build --dir results--encoding UTF-8 make

然后我想执行它执行前两个,当 docker 容器启动命令“docker exec /home/CO/CO_ANAlysis/bin/c-build --dir results--encoding UTF-8 make”不执行

如果我 运行 这个出自 docker:

docker exec -it -w /home/TA/G/T/P SDIO bash /home/CO/CO_ANAlysis/bin/c-build --dir results--encoding UTF-8 make

它告诉我:

/home/CO/CO_ANAlysis/bin/c-build: /home/CO/CO_ANAlysis/bin/c-build: cannot execute binary filehow can I, in a mk file, run commands inside a docker?

谢谢

问题已解决

  docker container start XXX;
  docker exec -it -w /home/TA/G/T/P XXX /home/CO/CO_ANAlysis/bin/c-build --dir results--encoding UTF-8 make