docker run program arguments in aws ecs











up vote
8
down vote

favorite












I have a working container in Amazon's ECS that runs a program as a task. I would like to pass some program arguments, as I would do when running locally with docker run. I have managed to do passing a new entrypoint in the container configuration in ECS, as if I were passing it in the docker run command line.



Unfortunately, when doing so, I am overriding the internal entrypoint that was already defined in the image. I would like to use the internal entrypoint, just adding some more command line arguments, like --debug options. Is there any way to do that?



Thanks in advance.










share|improve this question


























    up vote
    8
    down vote

    favorite












    I have a working container in Amazon's ECS that runs a program as a task. I would like to pass some program arguments, as I would do when running locally with docker run. I have managed to do passing a new entrypoint in the container configuration in ECS, as if I were passing it in the docker run command line.



    Unfortunately, when doing so, I am overriding the internal entrypoint that was already defined in the image. I would like to use the internal entrypoint, just adding some more command line arguments, like --debug options. Is there any way to do that?



    Thanks in advance.










    share|improve this question
























      up vote
      8
      down vote

      favorite









      up vote
      8
      down vote

      favorite











      I have a working container in Amazon's ECS that runs a program as a task. I would like to pass some program arguments, as I would do when running locally with docker run. I have managed to do passing a new entrypoint in the container configuration in ECS, as if I were passing it in the docker run command line.



      Unfortunately, when doing so, I am overriding the internal entrypoint that was already defined in the image. I would like to use the internal entrypoint, just adding some more command line arguments, like --debug options. Is there any way to do that?



      Thanks in advance.










      share|improve this question













      I have a working container in Amazon's ECS that runs a program as a task. I would like to pass some program arguments, as I would do when running locally with docker run. I have managed to do passing a new entrypoint in the container configuration in ECS, as if I were passing it in the docker run command line.



      Unfortunately, when doing so, I am overriding the internal entrypoint that was already defined in the image. I would like to use the internal entrypoint, just adding some more command line arguments, like --debug options. Is there any way to do that?



      Thanks in advance.







      amazon-web-services docker






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 10 '16 at 18:13









      cserpell

      127310




      127310
























          4 Answers
          4






          active

          oldest

          votes

















          up vote
          1
          down vote













          It was easy: the command line arguments can be passed as Command in ECS configuration, instead of entrypoint.






          share|improve this answer

















          • 9




            Would have loved to see an example of this.
            – Ducain
            May 11 '16 at 16:00






          • 1




            @Ducain Added details in separate answer: stackoverflow.com/a/53434585/2753241
            – udondan
            Nov 28 at 9:46




















          up vote
          1
          down vote













          You can add command line arguments for the container entry point when creating new ECS task revision in AWS console. Open your container settings, and under the ENVIRONMENT label put the comma-separated list of command line arguments into the "Command" field.



          Example:



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


          will add 2 command line arguments to your container entry point.






          share|improve this answer






























            up vote
            1
            down vote













            When you run a task in ECS you can specify container overrides.



            In the AWS console this can be found at the bottom in the Advanced Options section.



            enter image description here



            On the CLI you can pass in a JSON object with the overrides like so:



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


            The command is the CMD that gets executed inside the container.



            In the same way environment variables can be passed to a container. Here's the list of possible options as described in the aws-cli docs:



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


            For some reason the name always has to be set in the overrides. ¯_(ツ)_/¯






            share|improve this answer




























              up vote
              0
              down vote













              Use environment section in ecs task definition to inject your configs.



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


              Please refer to the following aws documentation
              http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_environment






              share|improve this answer























              • This is to add environment variable while starting the container.
                – Shantanu
                Feb 16 '17 at 8:47











              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f35924158%2fdocker-run-program-arguments-in-aws-ecs%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              1
              down vote













              It was easy: the command line arguments can be passed as Command in ECS configuration, instead of entrypoint.






              share|improve this answer

















              • 9




                Would have loved to see an example of this.
                – Ducain
                May 11 '16 at 16:00






              • 1




                @Ducain Added details in separate answer: stackoverflow.com/a/53434585/2753241
                – udondan
                Nov 28 at 9:46

















              up vote
              1
              down vote













              It was easy: the command line arguments can be passed as Command in ECS configuration, instead of entrypoint.






              share|improve this answer

















              • 9




                Would have loved to see an example of this.
                – Ducain
                May 11 '16 at 16:00






              • 1




                @Ducain Added details in separate answer: stackoverflow.com/a/53434585/2753241
                – udondan
                Nov 28 at 9:46















              up vote
              1
              down vote










              up vote
              1
              down vote









              It was easy: the command line arguments can be passed as Command in ECS configuration, instead of entrypoint.






              share|improve this answer












              It was easy: the command line arguments can be passed as Command in ECS configuration, instead of entrypoint.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Mar 10 '16 at 19:43









              cserpell

              127310




              127310








              • 9




                Would have loved to see an example of this.
                – Ducain
                May 11 '16 at 16:00






              • 1




                @Ducain Added details in separate answer: stackoverflow.com/a/53434585/2753241
                – udondan
                Nov 28 at 9:46
















              • 9




                Would have loved to see an example of this.
                – Ducain
                May 11 '16 at 16:00






              • 1




                @Ducain Added details in separate answer: stackoverflow.com/a/53434585/2753241
                – udondan
                Nov 28 at 9:46










              9




              9




              Would have loved to see an example of this.
              – Ducain
              May 11 '16 at 16:00




              Would have loved to see an example of this.
              – Ducain
              May 11 '16 at 16:00




              1




              1




              @Ducain Added details in separate answer: stackoverflow.com/a/53434585/2753241
              – udondan
              Nov 28 at 9:46






              @Ducain Added details in separate answer: stackoverflow.com/a/53434585/2753241
              – udondan
              Nov 28 at 9:46














              up vote
              1
              down vote













              You can add command line arguments for the container entry point when creating new ECS task revision in AWS console. Open your container settings, and under the ENVIRONMENT label put the comma-separated list of command line arguments into the "Command" field.



              Example:



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


              will add 2 command line arguments to your container entry point.






              share|improve this answer



























                up vote
                1
                down vote













                You can add command line arguments for the container entry point when creating new ECS task revision in AWS console. Open your container settings, and under the ENVIRONMENT label put the comma-separated list of command line arguments into the "Command" field.



                Example:



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


                will add 2 command line arguments to your container entry point.






                share|improve this answer

























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  You can add command line arguments for the container entry point when creating new ECS task revision in AWS console. Open your container settings, and under the ENVIRONMENT label put the comma-separated list of command line arguments into the "Command" field.



                  Example:



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


                  will add 2 command line arguments to your container entry point.






                  share|improve this answer














                  You can add command line arguments for the container entry point when creating new ECS task revision in AWS console. Open your container settings, and under the ENVIRONMENT label put the comma-separated list of command line arguments into the "Command" field.



                  Example:



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


                  will add 2 command line arguments to your container entry point.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited May 5 at 0:23

























                  answered Jan 27 at 20:24









                  endriju

                  46856




                  46856






















                      up vote
                      1
                      down vote













                      When you run a task in ECS you can specify container overrides.



                      In the AWS console this can be found at the bottom in the Advanced Options section.



                      enter image description here



                      On the CLI you can pass in a JSON object with the overrides like so:



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


                      The command is the CMD that gets executed inside the container.



                      In the same way environment variables can be passed to a container. Here's the list of possible options as described in the aws-cli docs:



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


                      For some reason the name always has to be set in the overrides. ¯_(ツ)_/¯






                      share|improve this answer

























                        up vote
                        1
                        down vote













                        When you run a task in ECS you can specify container overrides.



                        In the AWS console this can be found at the bottom in the Advanced Options section.



                        enter image description here



                        On the CLI you can pass in a JSON object with the overrides like so:



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


                        The command is the CMD that gets executed inside the container.



                        In the same way environment variables can be passed to a container. Here's the list of possible options as described in the aws-cli docs:



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


                        For some reason the name always has to be set in the overrides. ¯_(ツ)_/¯






                        share|improve this answer























                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote









                          When you run a task in ECS you can specify container overrides.



                          In the AWS console this can be found at the bottom in the Advanced Options section.



                          enter image description here



                          On the CLI you can pass in a JSON object with the overrides like so:



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


                          The command is the CMD that gets executed inside the container.



                          In the same way environment variables can be passed to a container. Here's the list of possible options as described in the aws-cli docs:



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


                          For some reason the name always has to be set in the overrides. ¯_(ツ)_/¯






                          share|improve this answer












                          When you run a task in ECS you can specify container overrides.



                          In the AWS console this can be found at the bottom in the Advanced Options section.



                          enter image description here



                          On the CLI you can pass in a JSON object with the overrides like so:



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


                          The command is the CMD that gets executed inside the container.



                          In the same way environment variables can be passed to a container. Here's the list of possible options as described in the aws-cli docs:



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


                          For some reason the name always has to be set in the overrides. ¯_(ツ)_/¯







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 22 at 15:57









                          udondan

                          33k9110124




                          33k9110124






















                              up vote
                              0
                              down vote













                              Use environment section in ecs task definition to inject your configs.



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


                              Please refer to the following aws documentation
                              http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_environment






                              share|improve this answer























                              • This is to add environment variable while starting the container.
                                – Shantanu
                                Feb 16 '17 at 8:47















                              up vote
                              0
                              down vote













                              Use environment section in ecs task definition to inject your configs.



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


                              Please refer to the following aws documentation
                              http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_environment






                              share|improve this answer























                              • This is to add environment variable while starting the container.
                                – Shantanu
                                Feb 16 '17 at 8:47













                              up vote
                              0
                              down vote










                              up vote
                              0
                              down vote









                              Use environment section in ecs task definition to inject your configs.



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


                              Please refer to the following aws documentation
                              http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_environment






                              share|improve this answer














                              Use environment section in ecs task definition to inject your configs.



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


                              Please refer to the following aws documentation
                              http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_environment







                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited May 13 '16 at 22:26









                              Mogsdad

                              32.7k1186191




                              32.7k1186191










                              answered May 13 '16 at 21:09









                              Shibashis

                              3,8891222




                              3,8891222












                              • This is to add environment variable while starting the container.
                                – Shantanu
                                Feb 16 '17 at 8:47


















                              • This is to add environment variable while starting the container.
                                – Shantanu
                                Feb 16 '17 at 8:47
















                              This is to add environment variable while starting the container.
                              – Shantanu
                              Feb 16 '17 at 8:47




                              This is to add environment variable while starting the container.
                              – Shantanu
                              Feb 16 '17 at 8:47


















                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f35924158%2fdocker-run-program-arguments-in-aws-ecs%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              What visual should I use to simply compare current year value vs last year in Power BI desktop

                              Alexandru Averescu

                              Trompette piccolo