You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a local docker compose file (for example with ecs-cli local create) that contains a container and an AWS secret will fail to populate the environment variables if the container name has dashes.
Description
Taking back the terminology of the initial issue: #797
From creating a docker compose file with command ecs-cli local create
# To docker-compose.local.ymlservices:
example-name-container:
environment:
<environment_variable_name>=${example-name-container_<environment_variable_name}}labels:
ecs-local.secret.environment_variable_name: "arn:aws:secretsmanager:region:aws_account_id:secret:secret_name-AbCdEf"
Expected Behavior
ecs-cli local up should get the value from the AWS Secret and set it in the environment variable <environment_variable_name>
A docker compose file freshly created from ecs-cli local create should work AS-IS
Observed Behavior
The issue is that, with example-name-container having an hyphen -, the container actually running on local will have the env var populated with the value name-container_<environment_variable_name} instead of the content of the secret.
(note the value truncated at the first dash)
Instead, if in the docker-compose file one manually modifies the example-name-container container name and all occurences in the environment to example (with no hyphen), then everything works as expected
The text was updated successfully, but these errors were encountered:
remidebette
changed the title
local up badly handles secrets if the docker-compose container name has dashesecs-cli local up badly handles secrets if the docker-compose container name has dashes
Jan 21, 2022
Summary
Creating a local docker compose file (for example with
ecs-cli local create
) that contains a container and an AWS secret will fail to populate the environment variables if the container name has dashes.Description
Taking back the terminology of the initial issue: #797
From creating a docker compose file with command
ecs-cli local create
We expect a docker-compose file such as:
Expected Behavior
ecs-cli local up
should get the value from the AWS Secret and set it in the environment variable<environment_variable_name>
A docker compose file freshly created from
ecs-cli local create
should work AS-ISObserved Behavior
The issue is that, with
example-name-container
having an hyphen-
, the container actually running on local will have the env var populated with the valuename-container_<environment_variable_name}
instead of the content of the secret.(note the value truncated at the first dash)
Instead, if in the docker-compose file one manually modifies the
example-name-container
container name and all occurences in the environment toexample
(with no hyphen), then everything works as expectedThe text was updated successfully, but these errors were encountered: