LinuxCommandLibrary

docker-service

manage containerized services in Docker Swarm

TLDR

Create a service

$ docker service create --name [name] [image]
copy
List services
$ docker service ls
copy
Inspect a service
$ docker service inspect [service]
copy
Scale a service
$ docker service scale [service]=[replicas]
copy
Update service image
$ docker service update --image [image]:[tag] [service]
copy
View service logs
$ docker service logs [service]
copy
Remove a service
$ docker service rm [service]
copy

SYNOPSIS

docker service command [options]

DESCRIPTION

docker service manages Swarm services. Services define how containers run in a swarm, including replicas, networks, and resource limits. Only available in Swarm mode. Services provide declarative configuration for running containers at scale with automatic scheduling, load balancing, rolling updates, and health monitoring across the cluster.

SUBCOMMANDS

create

Create a new service.
ls
List services.
inspect
Display detailed information.
update
Update a service.
scale
Scale services.
logs
Fetch service logs.
ps
List tasks of a service.
rm
Remove services.
rollback
Revert to previous version.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community