172k views
0 votes
Docker Services What is the command for creating a new Docker service? Pick ONE option -) $ docker service create --name -) $ docker create --name -) $ docker service -) $ docker service create --name --newservice

1 Answer

5 votes

Final answer:

The correct command for creating a new Docker service is $ docker service create --name. This command is used to initialize services in a Docker Swarm environment with a specific name and includes additional configuration options.

Step-by-step explanation:

The command for creating a new Docker service is $ docker service create --name. This command initializes a new service with a specified name in a Docker Swarm cluster. When using this command, you can append various options and arguments to define the service according to your needs, such as the image to use, the number of replicas, the network settings, and so on.

Here is an example of creating a Docker service:

  • $ docker service create --name my-service nginx

In this example, 'my-service' is the name of the service, and 'nginx' is the image that the service will use to run containers.

User Silentsurfer
by
8.5k points