Comments (12)
It seems to me that #129 is a duplicate of this. It would be really great to make ecs-cli
support multiple -f
.
In the meantime, there is a workaround : docker-compose
has a validation command that shows the yaml files' concatenation in the console :
docker-compose -f docker-compose.file1.yml -f docker-compose.file2.yml config
will output the concatenation of docker-compose.file1.yml
and docker-compose.file2.yml
.
from amazon-ecs-cli.
Hi, I have just started using AWS for running docker and this is the first issue i encountered, is there any update on this?
The workaround suggested by @floostmodern is good and can be put in a bash script to capture the output to a new file and execute the ecs-cli command with that file, but it would be better if the workaround was not required.
Thanks
from amazon-ecs-cli.
While it is true that docker-compose -f docker-compose.file1.yml -f docker-compose.file2.yml config
will output the merged config for all the given override files, the resulting file:
- is not valid YAML
- is not valid docker-compose format
- is not consumable by ecs-cli
- requires additional touch-ups before it can be successfully to
ecs-cli
I don't really see this as a valid work-around for this. If this feature is not to be supported, it would be helpful to show an error when ecs-cli is run with this type of syntax (today this is allowed, seems to work but silently fails):
ecs-cli compose -f docker-compose.yml -f docker-compose.override-aws.yml -p MyProject create
from amazon-ecs-cli.
We require this functionality as well to set a few environment/stage/cluster specific options for our containers. While we could potentially configure them with environment variables as well, it is much more inline with our development workflow to merge and overwrite them using different files.
We normally run services like this:
$ docker-compose -f service.yml -f stage.yml up/run
While the workaround by @floostmodern works for now, it would be great if ecs-cli
supported this functionality natively. Especially since, as @PeterRJones mentioned, the output cannot be used directly and needs to be cleaned up first.
from amazon-ecs-cli.
Building on what @floostmodern said, this works for me temporarily.
Full Command:
docker-compose -f docker-compose.yml -f docker-compose.production.yml config | sed "s/version: '2.0'/version: 2/" | ecs-cli compose --verbose --file /dev/stdin create
I tend to shorten it like so:
alias docker-compose-prod='docker-compose -f docker-compose.yml -f docker-compose.production.yml'
alias docker-compose-prod-config="docker-compose-prod config | sed \"s/version: '2.0'/version: 2/\""
alias ecs-cli-compose="docker-compose-prod-config | ecs-cli compose --file /dev/stdin --project-name $(basename $(pwd))"
Usage:
Just replace "ecs-cli compose" with "ecs-cli-compose".
ecs-cli help
ecs-cli-compose help
ecs-cli-compose create
ecs-cli-compose ps
from amazon-ecs-cli.
You can now run ecs-cli compose up
with multiple compose files with the latest commit. This will be included in the next release.
from amazon-ecs-cli.
@yinshiua Great! When is the next release is scheduled?
from amazon-ecs-cli.
Looks like it was included in the following release (according to the release notes):
https://github.com/aws/amazon-ecs-cli/releases/tag/v0.6.1
from amazon-ecs-cli.
I am still having this issue in v0.6.5... Is there any update on this? Was this feature removed after v0.6.1?
from amazon-ecs-cli.
this doesnt work for me with latest client:
ecs-cli compose --file docker-compose.yml --file docker-compose-aws.yml service up
so how to define multiple files? the overridden settings in my second file wont get picked up.
from amazon-ecs-cli.
@logemann Are you sure you are using the latest ecs-cli? The above example does work for me. If you run with —debug what task definition does it spit out?
from amazon-ecs-cli.
cant see a debug parameter. Tried several ways without luck. My ecs-cli version is 1.8
from amazon-ecs-cli.
Related Issues (20)
- Feat. Request: Allow environment variables to depend on CF intrinsic functions
- `ecs-cli local up` badly handles secrets if the docker-compose container name has dashes
- `ecs-cli local create` should docker-compose escape the env vars in entrypoint
- ECS_CONTAINER_METADATA_URI is not accessible in macOS
- ecs-cli compose task failing with "Fargate only supports network mode ‘awsvpc’"
- Question: can I override the location of config and credential files?
- Support OSX Arm64
- EKS - Creating nodegroup
- Allow specifying container parameters (cpu, memory) using ecs params HOT 1
- global --endpoint flag is not supported
- Launch Templates vs Launch Configurations HOT 3
- Link to "Information about specific compose versions and fields supported by the ecs-cli" is broken
- when I run a task locally it does not seem to pickup environment variable containing values from parameterstore
- Create ecs-service from ecs-cli
- Problem with Task not working when creating Docker Volume driver with capital letter "Local"
- [Feature Request] depends_on option in ecs params
- Add support for readonlyrootfilesystem schema
- How to copy files into ECS container?
- unable to pull image HOT 1
- User-data script has erroneous newline breaking shebang, incompatible with Cloud-init versions on AL2023 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-ecs-cli.