简体   繁体   English

如何将Java程序连接到docker-compose

[英]How to connect Java program to docker-compose

I wrote java program that sends POST and GET requests to docker (using docker remote API). 我编写了java程序,它将POST和GET请求发送到docker(使用docker远程API)。

Now I want to write a java program that can get a docker-compose.yml and run it. 现在我想编写一个java程序,它可以获得docker-compose.yml并运行它。

my docker version is: 1.11.2 我的docker版本是:1.11.2

my docker-compose version is: 1.9.0 我的docker-compose版本是:1.9.0

I'm working on Linux using MobaXterm. 我正在使用MobaXterm在Linux上工作。

How to do this? 这个怎么做?

Here is a tool to expose RESTful APIs to control docker-compose: 这是一个公开RESTful API来控制docker-compose的工具:

https://github.com/francescou/docker-compose-ui https://github.com/francescou/docker-compose-ui

From the site: 从网站:

The aim of this project is to provide a minimal HTTP API on top of Docker Compose while maintaining full interoperability with Docker Compose CLI. 该项目的目的是在Docker Compose之上提供最小的HTTP API,同时保持与Docker Compose CLI的完全互操作性。

The application can be deployed as a single container, there are no dependencies nor databases to install. 应用程序可以部署为单个容器,没有依赖项或数据库也无法安装。

Here are the API Docs: https://francescou.github.io/docker-compose-ui/api.html 以下是API文档: https//francescou.github.io/docker-compose-ui/api.html


This should allow you to write a similar tool to the one you wrote to communicate with docker's remote API. 这应该允许您编写与您编写的与docker的远程API通信的工具类似的工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM