Run a command in a running container with docker exec.

# To execute a command inside a running container (`-d`: detached mode, run command in the background):
docker exec -d <container> <command> <arguments>

# To execute an interactive shell in a running container:
docker exec -it <container> sh

# To set an environment variable in the current bash session:
docker exec -it -e VAR=1 <container> bash

# To set the working directory for the command to execute into:
docker exec -it -w </path/to/working/directory> <command>

# To execute a chain of commands:
docker exec -it <container> sh -c  "echo 'nice to meet you' && echo 'see ya later'"