我有一个php文件并使用Dockerfile构建。 在我的php文件中,如何从AWS Batch Job Definitions中获取参数集?

How to access the parameters set in AWS Batch Job Definition in my php file?

Job Definition JSON

{
    "jobDefinitionName": "...",
    "jobDefinitionArn": "...",
    "revision": 6,
    "status": "ACTIVE",
    "type": "container",
    "parameters": {
        "category_name": "job definition category"
    },
    "containerProperties": {
        ...
    }
}

This is my Dockerfile

FROM php:7.2
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
CMD [ "php", "./hello-world.php"]

This is my php file. "hello-world.php"

$parameters = getenv('parameters');
echo 'display the aws job parameters here: ' . json_encode($parameters);

I should have get the parameters set in AWS Batch Job.

I found the solution. To get the passed parameters, you have to use Ref::name_of_parameter. Then on your php file, just used "$argv" to get the parameters.