Forrest logo
back to the docker tool

docker:tldr:4dc26

docker: Create a new service.
$ docker service create --name ${service_name} ${image}:${tag}
try on your machine

This command is used in Docker to create a new service or application in a Docker Swarm cluster. Let's break down the command:

  • docker service create: This is the main command used to create a new service in Docker Swarm.
  • --name ${service_name}: This is an option to provide a name to the service. ${service_name} is a placeholder for the actual service name you want to provide. For example, --name myapp.
  • ${image}:${tag}: This option specifies the Docker image to use for the service. ${image} is a placeholder for the image name, and ${tag} is a placeholder for the image tag. For example, myapp_image:latest.

Overall, this command creates a new service with the specified name and uses the provided Docker image with the specified tag to run the service.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the docker tool