I need to write a sh script that will run a docker container, and then execute some commands from within the container itself. Here is a very dumbed down example:
#!/bin/bash
cd someDir
docker run some_docker_image
echo "hello world"
The problem is, when I write it like this, and then try to execute the script, the docker container will be started, but the echo command will not be executed until I manually quit from the docker container (it is not executed within the docker container at all).
How do I forward the echo command from the example to the docker container? (echo here is just a placeholder for a list of commands that need to be executed from within the docker container)
Rebuilding the docker image is not an option