171k views
3 votes
How do you create a service called 'my_example' with 4 replicas from the indicated image?

A) docker service create --name my_example --replicas 4 my_image

B) docker create service --name my_example --replicas 4 my_image

C) docker deploy --service my_example --replicas 4 my_image

D) docker service deploy --name my_example --replicas 4 my_image

1 Answer

3 votes

Final answer:

The correct command to create a service called 'my_example' with 4 replicas from the indicated image is option D) docker service deploy --name my_example --replicas 4 my_image.

Step-by-step explanation:

The correct command to create a service called 'my_example' with 4 replicas from the indicated image is option D) docker service deploy --name my_example --replicas 4 my_image.

The docker service deploy command is used to create a new service, while the --name flag is used to specify the name of the service as 'my_example'. The --replicas flag is used to specify the number of replicas as 4, and the my_image is the name of the image.

User Cheron
by
7.1k points