简体   繁体   English

部署到 Service Fabric 时,如何在 docker-compose 文件中设置有效的 ServiceDnsName?

[英]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.

相关问题 如何使用 Docker-compose 文件在 Azure WebApp 上部署 Grafana? - How I deploy Grafana on Azure WebApp with Docker-compose file? Azure 应用服务 - docker-compose 文件问题 - Azure App Service - docker-compose file issues 在 azure 应用服务中使用 docker-compose - Using docker-compose in azure app service docker-compose 不适用于 Azure 应用服务 - docker-compose not working on Azure App Service 为什么我的 docker-compose 中的 azure 文件共享无法在 Azure 容器实例中存储 mongodb 数据? - Why can't I use azure file share in my docker-compose to store mongodb data in Azure Container Instance? 如何在 azure 中使用 docker-compose 部署 graphql API - How can I deploy a graphql API with docker-compose in azure 部署到 Azure 应用程序时如何在 docker compose 中包含启动脚本 - How to include startup script in docker compose when deploying to Azure App 用于 Linux 容器的 Azure Web 应用服务未从 docker-compose 文件中获取环境变量 - Azure web app service for Linux containers not picking up environment variables from docker-compose file Azure 应用服务 - 我需要在 docker-compose 中公开端口吗 - Azure App Service - Am I required to expose port in docker-compose 将解决方案部署到Service Fabric群集时的问题 - Issues when deploying solution to Service Fabric cluster
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM