Docker Community Forums

Share and learn in the Docker community.

Is any Rest API available to create service in docker Image version 17.12

dockercloud
dockerhub
docker

(Loganathan123) #1

I just want to create a service using Rest API currently using docker Bash commands to create same. please do help am new to docker,it could be good if i get any examples.


(David Maze) #2

Enabling the Docker remote API has massive security implications; if you’re not extremely careful with it, you can very easily give unrestricted root access on your system to anyone on the network.

If you’re new to Docker, I would not try to use the REST API at all. There are Docker API libraries for many popular languages and I would use one of those. Scripting the Docker command line is just fine, and for many common tasks higher-level orchestration tools can do the job (Docker Compose, Docker Swarm, Kubernetes, Ansible, …) (at various levels of complexity, commitment, and Docker-specificity).


(Loganathan123) #3

Thanks for your quick reply.we developed one service in Java and deployed the same in docker container running in AWS instance.Same service could be talking to another application, for example one of the requirement is to display the service-name,Image-version,replicas etc running in docker container to display in screen.Currently we are executing Bash scripting commands in java like "docker service ls " and “docker service ps” to get details. Instead we needs to analyse any docker API supports java to create,update(start,stop,scale) and list service details.Any help towards the same could be highly appreciated.


(David Maze) #4

Yes, there are several. The Docker documentation also has a shorter listing.

Have you looked at any of the “bigger” container-management systems? Kubernetes is not “simple” to use or deploy, but it has a basic Web dashboard that can do this and there is a lot of existing tooling around it. You mention AWS, Amazon’s ECS might work for you if you don’t mind using Amazon’s tooling.


(Loganathan123) #5

Thanks for your suggestion we gone through documentation you shared from we are planning to go with docker-client supports Java API going forward will update on the same.