Docker launcher arguments in aws ecs

I have a working container in Amazon ECS that runs the program as a task. I would like to pass some arguments to the program, as it would be when running locally with docker run. I was able to transfer the new entry point to the container configuration in ECS, as if I were passing it on the command line docker run.

Unfortunately, in doing so, I redefine the internal entry point that has already been defined in the image. I would like to use an internal entry point by simply adding a few more command line arguments like --debugoptions. Is there any way to do this?

Thanks in advance.

+10
source share
5

: ECS .

+1

ECS AWS. ENVIRONMENT "Command".

:

--debug,--packages org.apache.hadoop:hadoop-aws:2.7.3

2 .

+1

ECS, .

AWS " ".

enter image description here

CLI JSON :

aws ecs run-task ... --overrides '{"containerOverrides": [{"name": "whatever", "command": ["foo", "bar"}]}'

command CMD, .

. , aws-cli:

{
  "containerOverrides": [
    {
      "name": "string",
      "command": ["string", ...],
      "environment": [
        {
          "name": "string",
          "value": "string"
        }
        ...
      ],
      "cpu": integer,
      "memory": integer,
      "memoryReservation": integer
    }
    ...
  ],
  "taskRoleArn": "string",
  "executionRoleArn": "string"
}

- name .¯\_ (ツ) _/¯

+1

ecs .

"environment" : [
    { "name" : "string", "value" : "string" },
    { "name" : "string", "value" : "string" }
]

, aws http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_environment

0

1. ,

python myscript.py --debug --name "joe schmoe" --quality best --dimensions 1920 1080

2.

FROM python:3.7-alpine

# Add the application folder to the container
COPY . /myscript
WORKDIR /myscript

# Install required packages
RUN pip install -r requirements.txt --upgrade

# Run the script when the container is invoked
ENTRYPOINT ["python", "myscript.py"]

3. / aws ecs "" "" , :

--debug,--name,joe schmoe,--quality,best,--dimensions,1920,1080

, joe schmoe, " ", - --quality best , --quality,best

enter image description here

4. , , :

["--debug","--name","joe schmoe","--quality","best","--dimensions","1920","1080"]

, CMD Dockerfile.

enter image description here

0

All Articles