Run bash script in container from host

Hi,

I need to use a program written by someone else within a Docker container. I have made a script file called bt.sh which runs the third party program with the correct options. It sits in a folder /root/FrMG_Files/.
I can run the script without problems from within the container (starting the container with the -it switch) with the command ./bt.sh from the folder /root/FrMG_Files.

I would like to automate the process by running the script from the windows host as part of a larger sequence.
In windows powershell, I tried to get the file list with :
docker exec -it -w /root/FrMG_Files container_id dir
This works and I see the script file.

I tried to run the script from windows powershell with many variations such as
docker exec -it -w /root/FrMG_Files container_id ./bt.sh
docker exec -it -w /root/FrMG_Files container_id './bt.sh --cmd “command” host''
docker exec -it -w /root/FrMG_Files container_id "./bt.sh"
but none of these worked.
I get the error message:
OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec format error": unknown

I guess I am missing only a small thing. I would greatly appreciate some help.

Many Thanks!

P.S. I am using Docker Desktop v19.03.12 in windows 10.

HI,
The script starts with an echo to checks that it works. Then it runs a syntax analyzer called frmg_shell. It does not install or modify the container in any way except storing the results and does not need permissions. frmg_shell is a perl program (10 GB in total) that is in the $PATH and can be run from any folder. Following the echo, the script is a list of commands like the one below with different FileName; where FileName is the text file to be analysed, Destination is the folder where the results should go, and conll is the format of the output.

echo "corpus FileName Destination :conll" | frmg_shell --batch

same problem!

Did you ever find a solution?

Hi, We found a solution that worked 1 or 2x but it did not worked after that and we were not able to make it work again. I start the docker batch manually.