I am trying to execute a tool (which requires spark-submit
available in the path) inside a Docker container with Apache Spark (indeed to resolve this issue, in Dockerfile I added the instruction RUN echo "export PATH=$PATH:/spark/bin" >> ~/.bashrc
).
If I connect to this Docker container (with the command sudo docker exec -it $spark_masterID bash
, as suggested here), the tool work without any problem and I can see the typical Spark output.
But in my case I am interested in calling this tool without connecting to the container, indeed I have a script in this container which calls the tool. In order to call it I use the command:
sudo docker exec -it $spark_masterID bash /path/script.sh
but this time the execution fails, reporting this error:
Make sure spark-submit is available in your path
What I am doing wrong?