How to use docker private registry while creating docker swarm service

We trying to pull image from the private registry while creating docker service in swarm mode. Please let us know the command for the same.

Log in to your registry: `docker login my-registry.com

and then when you are creating the service use --with-registry-auth