xxxxxxxxxx
echo -n "enter type compose command ? "
read type
[[ "$type" ]] && docker-compose $type;
xxxxxxxxxx
Follow these steps:
Use docker ps to get the name of the existing container.
Use the command docker exec -it <container name> /bin/bash to get a bash shell in the container.
Or directly use docker exec -it <container name> <command> to execute whatever command you specify in the container.