If we've to do some operations(execute commands) inside of docker container, we can go inside it and then execute commands -
docker exec -it <ContainerId> bash # go inside of container
cd /usr/local/tomcat/bin # hit command inside of container
./catalina.sh start # hit command inside of container
After this we need to hit Ctrl + C to come out of container.
But without going inside of container, can we execute commands inside of it from host directly like -
// command to attach to container
// command 1 to execute
// command 2 to execute
// no command required to come out of container as above commands directly hit from hosts