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.
amazon-web-services docker
add a comment |
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.
amazon-web-services docker
add a comment |
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.
amazon-web-services docker
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
amazon-web-services docker
asked Mar 10 '16 at 18:13
cserpell
127310
127310
add a comment |
add a comment |
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.
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
add a comment |
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.
add a comment |
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.
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. ¯_(ツ)_/¯
add a comment |
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
This is to add environment variable while starting the container.
– Shantanu
Feb 16 '17 at 8:47
add a comment |
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.
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
add a comment |
up vote
1
down vote
It was easy: the command line arguments can be passed as Command in ECS configuration, instead of entrypoint.
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
add a comment |
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.
It was easy: the command line arguments can be passed as Command in ECS configuration, instead of entrypoint.
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
add a comment |
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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
edited May 5 at 0:23
answered Jan 27 at 20:24
endriju
46856
46856
add a comment |
add a comment |
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.
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. ¯_(ツ)_/¯
add a comment |
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.
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. ¯_(ツ)_/¯
add a comment |
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.
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. ¯_(ツ)_/¯
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.
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. ¯_(ツ)_/¯
answered Nov 22 at 15:57
udondan
33k9110124
33k9110124
add a comment |
add a comment |
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
This is to add environment variable while starting the container.
– Shantanu
Feb 16 '17 at 8:47
add a comment |
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
This is to add environment variable while starting the container.
– Shantanu
Feb 16 '17 at 8:47
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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