hoverkraft-tech / compose-action

This action runs your docker-compose file and clean up before action finished
https://github.com/marketplace/actions/docker-compose-action
MIT License
135 stars 22 forks source link

Provides a way to setup docker-compose at a specific version #68

Open neilime opened 3 months ago

neilime commented 3 months ago

Is your feature request related to a problem? Please describe. Yes, the current problem is the lack of ability to specify a Docker Compose version within GitHub Actions. Currently, when setting up environments that require Docker Compose in GitHub Actions, it defaults to using the version that comes pre-installed on the GitHub runners. This can lead to inconsistencies and unexpected behavior in CI/CD pipelines, especially when the latest Docker Compose versions introduce breaking changes or when specific features of a certain Docker Compose version are needed. I find this frustrating because it forces our projects to adapt to the pre-installed Docker Compose version, rather than allowing us to specify the version that matches our development environments, leading to "it works on my machine" issues.

Describe the solution you'd like I would like a feature in the GitHub Actions setup where you can specify the version of Docker Compose to use in your workflows. Ideally, this would be a simple field or parameter in the GitHub Actions YAML configuration file where the desired Docker Compose version can be defined. For example:


steps:
  - name: Setup Docker Compose
    uses: docker/setup-compose-action@v1
    with:
      version: '1.29.2'

This solution would ensure that every run of the GitHub Actions workflow uses the specified Docker Compose version, leading to more predictable and consistent builds.

Describe alternatives you've considered An alternative solution I've considered is manually installing the desired Docker Compose version at the beginning of each workflow run. This can be achieved by running shell commands within the GitHub Actions workflow to uninstall the pre-installed version of Docker Compose and then download and install the specific version needed. However, this approach is cumbersome, error-prone, and increases the complexity of the CI/CD pipeline configuration. It also introduces additional overhead in terms of maintenance and execution time.

Additional context Being able to specify the Docker Compose version directly in GitHub Actions workflows would greatly enhance the flexibility and reliability of CI/CD pipelines, especially for projects that rely on specific Docker Compose features or face compatibility issues with newer versions. This feature would align with the principle of infrastructure as code, allowing teams to define and control their CI/CD environments more precisely and transparently.

Inspiration: https://github.com/ndeloof/install-compose-action

github-actions[bot] commented 3 months ago

Hi, thank for reporting an issue, we will check it out very soon