docker exec [options] CONTAINER COMMAND Run a command in a running container -d, --detach # run in background --detach-keys # override the key sequence for detaching a container -i, --interactive # stdin -t, --tty # interactive -u, --user # username or uid (format: <name|uid>[:<group|gid>])
$ docker exec app_web tail logs/runtime.log $ docker exec -t -i app_web rails c