You deploy a service in Docker Swarm with the command:
docker service create --name webapp --replicas 3 nginx
What will be the output of docker service ls regarding the replicas column immediately after deployment?
Think about how quickly replicas start after service creation.
Immediately after deployment, the service is created but replicas may not be running yet, so the output shows 0/3.
You want to update an existing service named api to have 5 replicas. Which command is correct?
Check the correct order and spelling of flags in docker service update.
The correct syntax places the service name before the flags and uses --replicas (plural) without equals sign.
You try to deploy a service with this command:
docker service create --name web --publish 80:80 nginx
But it fails with an error about port binding. What is the most likely cause?
Consider what prevents binding to a port on the host.
If port 80 is already used by another process or service on any node, the new service cannot bind to it.
Arrange the steps in the correct order to deploy a service named db with 2 replicas and then scale it to 4 replicas.
Think about deploying first, then checking status, then scaling.
First create the service, then list services, check tasks, then update replicas.
You want to update a service's image without downtime. Which option ensures rolling updates with minimal disruption?
Look for options controlling update speed and parallelism.
Using --update-parallelism and --update-delay allows rolling updates one task at a time, avoiding downtime.