如何创建docker容器作为对REST API查询的响应,以下载数据?

时间:2019-07-09 09:59:10

标签: docker swagger-ui minikube

我正在swagger-ui上测试我的REST应用程序,但我正在努力找出应该如何使用POST查询中传递的参数来运行dockerfile以及图像,容器的结构并根据查询创建卷?

这是我要运行的查询:

{
  "jobs": [
    {
      "container": {
        "args": [
          "string"
        ],
        "command": "string",
        "image": "cdi_ingestion",
        "properties": {
          "scihub_username": "username",
          "scihub_password": "password",
          "producttype": "S2MSI2A",
          "platformname": "Sentinel-2",
          "footprint":"POLYGON((5.8664000 50.3276000,9.4623000 50.3276000,9.4623000 52.5325000,5.8664000 52.5325000,5.8664000 50.3276000))",
          "days_back": 7
        },
        "volumes": [
          {
            "mountPath": "/out_data",
            "name": "cdi_workspace"
          }
        ]
      },
      "jobName": "ingestion"
    }
  ],
  "workflowName": "ingestion_and_preprocessing"
}

这是dockerfile,一旦在swagger-ui上单击POST按钮,就应该运行该文件。

docker run --rm -v $(pwd):/out_data \
-e scihub_username=test \
-e scihub_password=test \
-e producttype=S2MSI2A \
-e platformname=Sentinel-2 \
-e start_date=2019-06-09T00:00:00.000Z \
-e end_date=2019-06-12T00:00:00.000Z \
-e days_back=7 \
-e footprint="POLYGON((5.8664000 50.3276000,9.4623000 50.3276000,9.4623000 52.5325000,5.8664000 52.5325000,5.8664000 50.3276000))" \
-e max_cloud_cover_percentage=10 \
-e CDINRW_BASE_URL=localhost:8080/swagger-ui.html \
-e CDINRW_JOB_ID=3fa85f64-5717-4562-b3fc-2c963f66afa6 \
cdi_ingestion

理想情况下,它应该处理查询并将数据下载到docker映像中,但它却给了我500 undocumented error。如何解决?

0 个答案:

没有答案