#docker run vs exec: deep-dive into their differences
▻https://hackernoon.com/docker-run-vs-exec-deep-dive-into-their-differences-19a1041735a3?source=
Both Docker run and exec execute commands in a Docker container. However, there are key differences in their use that suit different situations.Docker logo. Source: Docker on GithubDocker concepts, such as images and containers- Docker: Get StartedUsing Docker commands- Top 10 Docker commands you can’t live without- Run #bash or any command in a Docker containerrunUse this to run a command in a new container. It suits the situation where you do not have a container running, and you want to create one, start it and then run a process on it.docker run [OPTIONS] IMAGE [COMMAND] [ARG...]Following the docker run command, you must specify the image to create the container from, but there are optional arguments you can pass as well. For example:docker run —name ubuntu_bash —rm -i -t ubuntu (...)