1

I want to deploy service into already running Docker Stack via Docker API for Go-lang.

As dockerAPI only accepts json as described in their docs, I an searching for a tool that could covert compose.yaml to the json accepted by dockerAPI.

Alternatively, it would be great if there is any method in go-lang DockerAPI that can create service directly using yaml data as we provide in compose.yml.

Example Yaml:

myapp: image: amithp/pyapp:latest deploy: replicas: 3 restart_policy: condition: on-failure networks: - frontend-network environment: - MYENV=myapp labels: myproject: "xyz" label1: "somevar"

I am fairly new to both DockerAPI and Go-lang, any suggestion or direction will be greatly helpful.

wannamit
  • 117
  • 3
  • 9
  • I'm not sure it's one API call, compose does a lot of orchestration. I'd start in the [service python](https://github.com/docker/compose/blob/master/compose/service.py). – Matt Nov 17 '17 at 06:14
  • I agreed with @Matt comment. The same discussion can be found here https://stackoverflow.com/questions/47250271/control-docker-compose-in-java/47259018?noredirect=1#comment81500536_47259018. You can get one or two things – sayboras Nov 17 '17 at 09:46
  • thanks for the info. I will take a look. – wannamit Nov 17 '17 at 10:27

0 Answers0