Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support docker-compose-plugin as provider for docker_compose resource #891

Open
kenyon opened this issue Jan 30, 2023 · 11 comments · May be fixed by #902
Open

Support docker-compose-plugin as provider for docker_compose resource #891

kenyon opened this issue Jan 30, 2023 · 11 comments · May be fixed by #902

Comments

@kenyon
Copy link
Contributor

kenyon commented Jan 30, 2023

Use Case

The docker_compose resource in this module should support the Docker Compose plugin.

Describe the Solution You Would Like

The docker_compose resource uses docker-compose-plugin rather than failing with Error: Could not find a suitable provider for docker_compose.

Describe Alternatives You've Considered

Installing standalone Docker Compose would be an alternative, but that is not supported by upstream per https://docs.docker.com/compose/install/ and upstream provides docker-compose-plugin as packages per https://docs.docker.com/compose/install/linux/.

Additional Context

See also: #839

@vegaaz
Copy link

vegaaz commented Feb 4, 2023

This should be focused. According to the `documentation docker-compose v1 is going to loose support after june 2023.

@vegaaz
Copy link

vegaaz commented Feb 17, 2023

@kenyon I am currently working on this.
Should we consider 'dropping support' for v1 and remove the code base?

@kenyon
Copy link
Contributor Author

kenyon commented Feb 18, 2023

@vegaaz since v1 is unsupported upstream, removing support in this module would be 👍 from me.

@kenyon kenyon linked a pull request Feb 24, 2023 that will close this issue
@robertc99
Copy link

docker-ce ships with a version of docker-compise on /usr/libexec/docker/cli-plugins/docker-compose
but the module doesnt use it by default since its not on the standard path.
If you change your path to include /usr/libexec/docker/cli-plugins/ before running puppet then docker_compose will find it and use it.

So all that needs to be done is adjust the default path used by the docker_compose resource
But Im not sure how to do that.

@kenyon
Copy link
Contributor Author

kenyon commented Jul 6, 2023

/usr/libexec is not supposed to be in PATH. I think it's best to stick with installing docker-compose-plugin per upstream documentation.

@kenyon
Copy link
Contributor Author

kenyon commented Jul 6, 2023

Also, at least with Ubuntu and Red Hat packages provided by Docker, /usr/libexec/docker/cli-plugins/docker-compose is provided by the docker-compose-plugin package, not the docker-ce package.

@robertc99
Copy link

Ok, the docker-compose is installed by the docker-compose-plugin package, not docker-ce itself.
But even though it is installed, the docker module won't use it.

How do we get the module to use it if we dont change the path.
Should the module create a link to it in /usr/local/bin?

@robertc99
Copy link

I checked the upstream documentation, which recommends installing the plugin package. But even when you do that, the module doesnt use it.

@kenyon
Copy link
Contributor Author

kenyon commented Jul 6, 2023

I checked the upstream documentation, which recommends installing the plugin package. But even when you do that, the module doesnt use it.

That's the point of this issue. The module needs to be updated so that it uses docker compose (with a space).

@Mike7518
Copy link

A temporary solution that works for my use case is adding a script that redirects to compose plugin :

file { '/usr/bin/docker-compose':
  ensure  => file,
  mode    => '0755',
  content => 'docker compose "$@"',
}

docker_compose { 'my_compose':
  ...
}

@kenyon
Copy link
Contributor Author

kenyon commented Aug 22, 2024

This should have been closed with the merge of #975.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants