简体   繁体   English

Kompose功能类似于docker-compose链接

[英]Kompose feature similar to docker-compose links

We are doing a POC using docker for integration tests. 我们正在使用docker进行POC集成测试。 We have a container with the image of an api and another container with one mongodb. 我们有一个带有api图像的容器,另一个带有一个mongodb的容器。

The api container must access mongodb via db-mongo-dev-company.aws.local, so I put the following entry in docker-compose: api容器必须通过db-mongo-dev-company.aws.local访问mongodb,因此我将以下条目放入docker-compose中:

links: - "mongodb: db-mongo-dev-company.aws.local" 链接:-“ mongodb:db-mongo-dev-company.aws.local”

It works perfectly with "docker-compose up". 它与“ docker-compose up”完美配合。

The problem is that kompose does not have support for the feature "links", according to the following link: 问题在于,根据以下链接,kompose不支持功能“链接”:

https://github.com/kubernetes/kompose/blob/master/docs/conversion.md https://github.com/kubernetes/kompose/blob/master/docs/conversion.md

We can't find an alternative to make this link, do you have any idea? 我们找不到替代方法来建立此链接,您有任何想法吗?

To solve this situation, I simply changed the url in the properties of the api project. 为了解决这种情况,我只是在api项目的属性中更改了url。

Example: I Have a file named bootstrap.yaml in src/main/resources that is looking for the spring cloud. 示例:我在src / main / resources中有一个名为bootstrap.yaml的文件,它正在寻找春天的云。 In the DockerFile, after i pull the image of the api, i replace the file by another bootstrap.yaml file with another properties, changing the url of the mongodb. 在DockerFile中,在拉取api的图像后,我将文件替换为具有其他属性的另一个bootstrap.yaml文件,从而更改了mongodb的url。

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

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