pagkly
pagkly

Reputation: 111

Can I start multiple Docker containers based on same image at the same time?

I have already setup a few containers based on one image but every time I boot the hosts (in Ubuntu primarily) I have to restart multiple docker container manually but the majority has the same image.

I know I can do it with some kind of customisation to the boot command but I am curious whether I can directly just have the command start containers that are based on selected images since each of these containers have different names.

Thank you.

Upvotes: 0

Views: 953

Answers (1)

Ricardo Branco
Ricardo Branco

Reputation: 6079

Use the --restart=always on docker run.

More details in:

https://docs.docker.com/engine/reference/run/#restart-policies-restart

Upvotes: 1

Related Questions