如何部署Docker镜像到SAP Cloud Platform

举报
汪子熙 发表于 2022/02/27 16:04:04 2022/02/27
【摘要】 参考SAP官方的帮助文档:https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/c190ad6eeb78428c91a2b66e5557f962.html第一次尝试,我遇到了下图的错误消息:You have exceeded your organization’s memory limit: app ...

参考SAP官方的帮助文档:https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/c190ad6eeb78428c91a2b66e5557f962.html

第一次尝试,我遇到了下图的错误消息:

You have exceeded your organization’s memory limit: app requested more memory than available
FAILED

要解决该错误,增大该Subaccount的memory quota即可:

第二次尝试遇到的错误消息:

Failed getting docker image manifest by tag: errors:
denied: requested access to the resource is denied
unauthorized: authentication required


登录docker hub,确认使用的docker镜像和tag是否正确:

https://hub.docker.com/repository/docker/i042416/ui5-nginx

最后成功部署:


在SAP云平台上看到成功部署的Docker应用:

拿到应用的url:

可以成功访问了:


我有一个应用部署在SAP云平台上,完整url为:

https://account.hana.ondemand.com/cockpit/#/globalaccount/8c7b2676-8dd1-4a97-bf24-998398f531c2/subaccount/5a9aab80-119b-4371-aa15-43008ebd355f/org/10789717-e078-4d24-bfe0-b5643c67e0e8/space/1e557935-4ec4-4e36-8055-701b27798258/app/5691ae25-0b85-440a-aa92-fb6d2dc317fb/overview

url最后的guid即该应用的guid,可以通过下面的命令行获得:

cf app jerryjavadocker --guid

使用下面的命令行获得该应用的详细信息:

cf curl /v2/apps/5691ae25-0b85-440a-aa92-fb6d2dc317fb > 1.txt

明细:

{
   "metadata": {
      "guid": "5691ae25-0b85-440a-aa92-fb6d2dc317fb",
      "url": "/v2/apps/5691ae25-0b85-440a-aa92-fb6d2dc317fb",
      "created_at": "2020-02-11T04:16:36Z",
      "updated_at": "2020-02-12T03:47:08Z"
   },
   "entity": {
      "name": "jerryjavadocker",
      "production": false,
      "space_guid": "1e557935-4ec4-4e36-8055-701b27798258",
      "stack_guid": "c0fdd885-3e8f-4859-9fa4-c0c9373cdeff",
      "buildpack": null,
      "detected_buildpack": null,
      "detected_buildpack_guid": null,
      "environment_json": {},
      "memory": 1024,
      "instances": 1,
      "disk_quota": 1024,
      "state": "STARTED",
      "version": "368a950e-86a3-467a-81e2-b32a9785ef29",
      "command": null,
      "console": false,
      "debug": null,
      "staging_task_id": "5d5ab21c-c5e0-44f9-8ee2-84551b25e81b",
      "package_state": "STAGED",
      "health_check_type": "port",
      "health_check_timeout": null,
      "health_check_http_endpoint": "",
      "staging_failed_reason": null,
      "staging_failed_description": null,
      "diego": true,
      "docker_image": "i042416/springbootexample:v6",
      "docker_credentials": {
         "username": null,
         "password": null
      },
      "package_updated_at": "2020-02-12T03:47:07Z",
      "detected_start_command": "/bin/sh -c exec java $JAVA_OPTS -jar /app.jar ",
      "enable_ssh": false,
      "ports": [
         8080
      ],
      "space_url": "/v2/spaces/1e557935-4ec4-4e36-8055-701b27798258",
      "stack_url": "/v2/stacks/c0fdd885-3e8f-4859-9fa4-c0c9373cdeff",
      "routes_url": "/v2/apps/5691ae25-0b85-440a-aa92-fb6d2dc317fb/routes",
      "events_url": "/v2/apps/5691ae25-0b85-440a-aa92-fb6d2dc317fb/events",
      "service_bindings_url": "/v2/apps/5691ae25-0b85-440a-aa92-fb6d2dc317fb/service_bindings",
      "route_mappings_url": "/v2/apps/5691ae25-0b85-440a-aa92-fb6d2dc317fb/route_mappings"
   }
}


查看route明细:cf curl /v2/apps/5691ae25-0b85-440a-aa92-fb6d2dc317fb/routes

从结果里获得route的guid:4637819d-430f-438f-81f6-8a7742d3027e

再获取该route的明细:

cf curl /v2/routes/4637819d-430f-438f-81f6-8a7742d3027e/route_mappings

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。