How to run multiple commands in Docker Container

arunksingh16

Arun Kumar Singh

Posted on April 25, 2021

How to run multiple commands in Docker Container

There can be scenarios in which you may have to run/execute commands using a container to get something done.

docker run <your container> /bin/bash -c "command1; command2"

arun@mymachine:~ sudo docker run singharunk/dev /bin/bash -c "date; whoami"
Sun Apr 25 19:58:50 UTC 2021
root
Enter fullscreen mode Exit fullscreen mode

💖 💪 🙅 🚩
arunksingh16
Arun Kumar Singh

Posted on April 25, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related