[英]How do I set a valid ServiceDnsName in my docker-compose file when deploying to Service Fabric?
I am attempting to configure CI/CD in Visual Studio Team Services to a Service Fabric cluster from a docker-compose file, but in the last step of my release definition, using the step "Service Fabric Compose Deploy", I'm getting the error: ##[error]The ServiceDnsName for DefaultService 'myapp' is invalid.
我正在尝试将 Visual Studio Team Services 中的 CI/CD 从 docker-compose 文件配置为 Service Fabric 群集,但在我的发布定义的最后一步中,使用步骤“Service Fabric Compose Deploy”,我得到了错误:
##[error]The ServiceDnsName for DefaultService 'myapp' is invalid.
. . The guide I'm using has a section that says:
我正在使用的指南有一个部分说:
If the service name that you specify in a Compose file is a fully qualified domain name (that is, it contains a dot [.]), the DNS name registered by Service Fabric is <ServiceName> (including the dot).
如果您在 Compose 文件中指定的服务名称是完全限定的域名(即包含点 [.]),则 Service Fabric 注册的 DNS 名称为 <ServiceName>(包括点)。 If not, each path segment in the application name becomes a domain label in the service DNS name, with the first path segment becoming the top-level domain label.
如果不是,则应用程序名称中的每个路径段将成为服务 DNS 名称中的域标签,第一个路径段将成为顶级域标签。
For example, if the specified application name is fabric:/SampleApp/MyComposeApp, <ServiceName>.MyComposeApp.SampleApp would be the registered DNS name.
例如,如果指定的应用程序名称是 fabric:/SampleApp/MyComposeApp,则 <ServiceName>.MyComposeApp.SampleApp 将是注册的 DNS 名称。
My current docker-compose file is:我当前的 docker-compose 文件是:
version: '3'
services:
myapp:
image: myapp
build:
context: .\myapp
dockerfile: Dockerfile
In the VSTS definition, the Application Name is set as fabric:/myapp
.在 VSTS 定义中,应用程序名称设置为
fabric:/myapp
。
How do I fix this?我该如何解决? Ideally I would like my app to be accessible at
yourendpointhere.eastus.cloudapp.azure.com/myapp
.理想情况下,我希望我的应用程序可以在
yourendpointhere.eastus.cloudapp.azure.com/myapp
上访问。 Is this possible?这可能吗?
Here's the log entry for the release step failure:这是发布步骤失败的日志条目:
2018-02-14T18:30:00.8056376Z ##[section]Starting: Deploy docker-compose application to a Service Fabric cluster
2018-02-14T18:30:00.8060539Z ==============================================================================
2018-02-14T18:30:00.8060913Z Task : Service Fabric Compose Deploy
2018-02-14T18:30:00.8061507Z Description : Deploy a docker-compose application to a Service Fabric cluster.
2018-02-14T18:30:00.8061986Z Version : 0.2.3
2018-02-14T18:30:00.8062279Z Author : Microsoft Corporation
2018-02-14T18:30:00.8063154Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=847030)
2018-02-14T18:30:00.8063536Z ==============================================================================
2018-02-14T18:30:07.8698092Z Searching for path: D:\a\r1\a\**\docker-compose.yml
2018-02-14T18:30:07.8725249Z Found path: D:\a\r1\a\Drop\docker-compose\docker-compose.yml
2018-02-14T18:30:07.9023293Z Checking compose file
2018-02-14T18:30:16.8571892Z ##[warning]The Docker compose file contains the following 'keys' which are not supported. They will be ignored.
'build'
2018-02-14T18:30:17.1220353Z Imported cluster client certificate with thumbprint 'THUMBPRINT_REDACTED'.
2018-02-14T18:30:17.1899791Z
2018-02-14T18:30:17.1907044Z Thumbprint Subject
2018-02-14T18:30:17.1908148Z ---------- -------
2018-02-14T18:30:17.1909375Z THUMBPRINT_REDACTED CN=eastus.cloudapp.azure.com
2018-02-14T18:30:23.8293246Z Successfully connected to cluster.
2018-02-14T18:30:23.8391402Z Encrypting the password with the Server Certificate.
2018-02-14T18:30:25.1024103Z ##[warning]The cluster's server certificate with thumbprint '********' is required in order to encrypt text but the certificate could not be found on the agent machine in the 'CurrentUser\My' certificate store location.
2018-02-14T18:30:25.7091733Z Creating application
2018-02-14T18:30:29.7025507Z ##[error]The ServiceDnsName for DefaultService 'myapp' is invalid.
FileName: D:\SvcFab\IB\131631066259308291\2fve3lf5.5tp\ApplicationManifest.xml
2018-02-14T18:30:29.9330549Z ##[section]Finishing: Deploy docker-compose application to a Service Fabric cluster
With the help of Microsoft support I was able to solve this issue.在微软支持的帮助下,我能够解决这个问题。
The Application name was the problem.应用程序名称是问题所在。 If you remove the "fabric:/" part of the application name it worked for me.
如果您删除应用程序名称的“fabric:/”部分,它对我有用。
It is a documentation error.这是一个文档错误。 Microsoft support will update the documentation
Microsoft 支持将更新文档
At least now the VSTS steps works and is deployed to Service Fabric.至少现在 VSTS 步骤可以工作并部署到 Service Fabric。 I now get some errors in the Service Fabric itself but that is for another question.
我现在在 Service Fabric 本身中遇到一些错误,但这是另一个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.