Create First service in Docker Swarm

Hello Colleague,

I am new to docker , based on the docker document i have learnt how to create container , images . And i am able to run the container and use them for test.
As of now we are using Docker CE , but we would be using docker EE , when we move applications live.

As part of this we also want to test Docker swarm ,and see how auto scaling will works.
So i have configured swarm mode on one of the host internally using Docker CE version

Server:
Version: 17.05.0-ce
API version: 1.29 (minimum version 1.12)

I want to know how to deploy a service in docker swarm, i have tried using
"Docker swarm create " command but the replication are not starting . I am unable to access that machine.

Here is what i was doing to deploy an service in Swarm

  1. I have a base image , and i have done all the changes in the base image . I have committed the base image with to “new image id”.
  2. My new image is running Centos 6 and tomcat6 is the application that is running in the base image.
    3…To validate the new image i have run that image in a container to validate if all my changes have been exists or not. I was able to see my changes.
  3. Now i want to deploy that image into docker swarm . So using " Docker service create " i was trying to deploy my “new image id” to swarm mode. but REPLICAS was never coming up.
  4. What i am thinking is because there is no running process in side swarm that container is restarting.

Could you please help me in deploying my custom image which has tomcat running in docker swarm mode . Very important thing that we want to test her is scaling of containers.

Thanks,
Vardhan.