Update docker compose
Update docker compose to the latest version (2.16.0) & install it as docker plugin on linux server since compose v1 will be deprecated on June 2023.
reference: https://docs.docker.com/compose/install/linux/
docker::compose is a class
Breaking changes to this file WILL impact these 3 modules (exact match):
docker::params is a class
that may have no external impact to Forge modules.
This module is declared in 6 of 580 indexed public Puppetfiles.
These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.
Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.
Looks like this intends to fix #891.
@davidphay I've noticed a small issue while testing this PR:
$ file /usr/local/bin/docker-compose-2.16.0
/usr/local/bin/docker-compose-2.16.0: ASCII text, with no line terminators
$ cat /usr/local/bin/docker-compose-2.16.0
Not Found
It seems like the version 1.x download URL does not work for version 2.x:
$ curl -v https://github.com/docker/compose/releases/download/2.16.0/docker-compose-Linux-x86_64
...
< HTTP/2 404
< server: GitHub.com
On Docker Compose version 2.x the version number must be prefixed with a v in the download URL:
$ curl -v https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-Linux-x86_64
...
< HTTP/2 302
< server: GitHub.com
@davidphay I've noticed a small issue while testing this PR:
$ file /usr/local/bin/docker-compose-2.16.0 /usr/local/bin/docker-compose-2.16.0: ASCII text, with no line terminators $ cat /usr/local/bin/docker-compose-2.16.0 Not FoundIt seems like the version 1.x download URL does not work for version 2.x:
$ curl -v https://github.com/docker/compose/releases/download/2.16.0/docker-compose-Linux-x86_64 ... < HTTP/2 404 < server: GitHub.comOn Docker Compose version 2.x the version number must be prefixed with a
vin the download URL:$ curl -v https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-Linux-x86_64 ... < HTTP/2 302 < server: GitHub.com
Thanks, I fixed the issue !
Wouldn’t it be a preferred way to install docker compose v2 via “docker-compose-plugin” package as described here https://docs.docker.com/compose/install/linux/#install-using-the-repository ? Also setting the version via params leads to technical debt in my mind - do you agree ?
Wouldn’t it be a preferred way to install docker compose v2 via “docker-compose-plugin” package as described here https://docs.docker.com/compose/install/linux/#install-using-the-repository ? Also setting the version via params leads to technical debt in my mind - do you agree ?
I agree on both.
Wouldn’t it be a preferred way to install docker compose v2 via “docker-compose-plugin” package as described here https://docs.docker.com/compose/install/linux/#install-using-the-repository ? Also setting the version via params leads to technical debt in my mind - do you agree ?
I started working on this issue too, but I am currently busy… Maybe this can help you ?
if $ensure == 'present' {
if $facts['os']['family'] == 'windows' {
# will be defined soon
# https://docs.docker.com/compose/install/other/
}
else {
case $facts['os']['family'] {
'Debian': {
ensure_packages('docker-compose-plugin', { ensure => pick($version,$ensure), require => defined('$docker::use_upstream_package_source') ? { true => Apt::Source['docker'], false => undef } }) #lint:ignore:140chars
}
'RedHat': {
ensure_packages('docker-compose-plugin', { ensure => pick($version,$ensure), require => defined('$docker::use_upstream_package_source') ? { true => Yumrepo['docker'], false => undef } }) #lint:ignore:140chars lint:ignore:unquoted_string_in_selector
}
default: {}
}
}
}
@kenyon Hello, I updated the code, is it good for you now ?
@kenyon linting issue should be fixed
We need someone from @puppetlabs to approve the GitHub Actions jobs.
@davidphay The reviewer added some notes, would you mind to fix these two things? Would love to finally see this PR getting merged. :blush:
@davidphay Thank you for the work you've done on this PR, it has saved me some work. I'd love to get it merged as well and I am available to assist if you don't mind.
its become more critical that this gets merged since docker-compose v1 has become unreliable.
Testing this code. Appears to work ok. Does generate the following warning Warning: This function is deprecated, please use stdlib::ensure_packages instead. at ["/etc/puppetlabs/code/environments/stagingcloudv3/r10k/modules/docker/manifests/compose.pp", 26]
This should be closed now that #975 was merged.