AlanCVL
AlanCVL

Reputation: 1

How start 2 containers docker at the same time

I start now study Docker and I need start 2 containers in Docker at the same time, the container has already been created: container_1 and container_2. How can I use the command docker start container_1 and docker start container_2 at the same time?

Upvotes: 0

Views: 5189

Answers (3)

Nettemsarath
Nettemsarath

Reputation: 101

u need to write a docker-compose file , without using links or depends as those two containers are independent..then> sudo docker compose up wil start running those containers for u ..

Upvotes: 0

Andruida
Andruida

Reputation: 384

You can specify multiple containers in docker start.

docker start container_1 container_2

They won't start at exactly the same time, but they'll start closely after eachother.

Upvotes: 2

Frank
Frank

Reputation: 489

It would be better to explain why you’re trying to do this. My best guess is that you’re trying to plumb together these containers, so you should consider using a coordination mechanism such as docker-compose or kubernetes to automatically manage the coordination for you.

Upvotes: 0

Related Questions