首页 > 解决方案 > appId: error.pattern 在 Marathon 中创建应用程序时

问题描述

我正在尝试使用 Web 控制台在 Marathon 中创建一个应用程序。这是 JSON 文件:

{
    "id": "TestSpringApplication",
    "cmd": "/usr/bin/java -jar -Dspring.profiles.active=test /spring-boot-rest-example-0.5.0.war",
    "cpus": 1,
    "mem": 32.0,
    "networks": [ { "mode": "container/bridge" } ],
    "container": {
      "type": "DOCKER",
      "docker": {
        "image": "openjdk:8-jre-alpine"
      },
      "portMappings": [
        { "containerPort": 8090, "hostPort": 8090 }, {"containerPort": 8091, "hostPort": 8091 }],
      "volumes" : [
          {
          "containerPath": "/",
          "mode": "RW",
          "hostPath": "/root/spring-boot-rest-example/target"
          }
        ]
    }
}

但是当我把它放在盒子里时,它出现了这个错误:

你的配置有问题

appId:error.pattern

有人面临这个问题吗?我搜索了很多文档,但没有找到任何有用的信息

标签: dockercontainersmesosmarathonmesosphere

解决方案


AppID(又名PathID必须满足某些标准

由一系列由斜杠分隔的名称组成的 pod 的唯一标识符。每个名称必须至少包含 1 个字符,并且只能包含数字 ( 0-9)、破折号 ( -)、点 ( .) 和小写字母 ( a-z)。名字不能开始

并匹配

^(\/?((\.\.)|(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9]))?($|\/))+$

https://github.com/mesosphere/marathon/blob/7523b83799cd4ac0d3ce7ce0392edf77fd84e418/docs/docs/rest-api/public/api/v2/types/stringTypes.raml#L23-L31


推荐阅读