Giter Club home page Giter Club logo

Comments (12)

floostmodern avatar floostmodern commented on July 18, 2024 11

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.

chrisckc avatar chrisckc commented on July 18, 2024

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.

PeterRJones avatar PeterRJones commented on July 18, 2024

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.

jdno avatar jdno commented on July 18, 2024

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.

AlJohri avatar AlJohri commented on July 18, 2024

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.

yinshiua avatar yinshiua commented on July 18, 2024

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.

timwah avatar timwah commented on July 18, 2024

@yinshiua Great! When is the next release is scheduled?

from amazon-ecs-cli.

jfroom avatar jfroom commented on July 18, 2024

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.

rogersgt avatar rogersgt commented on July 18, 2024

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.

logemann avatar logemann commented on July 18, 2024

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.

esetnik avatar esetnik commented on July 18, 2024

@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.

logemann avatar logemann commented on July 18, 2024

cant see a debug parameter. Tried several ways without luck. My ecs-cli version is 1.8

from amazon-ecs-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.