-
Notifications
You must be signed in to change notification settings - Fork 71
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
Set docker-compose version to latest #30
Comments
Unfortunately the download URLs for docker-compose don't have a latest URL that will always get the latest. But you can configure the version being downloaded by setting |
@leighmcculloch It's possible to determine the latest docker-compose version. The URL https://github.com/docker/compose/releases/latest will always redirect to the latest version, so the Location-Header contains the needed informationen. I'm not an ruby developer, but i think it's possible to replace this line vagrant-docker-compose/lib/vagrant-docker-compose/cap/linux/docker_compose_install.rb Line 8 in 482f103
with something like this version = config.compose_version
if version == 'latest'
version = Net::HTTP.get_response(URI('https://github.com/docker/compose/releases/latest'))['Location'].split('/').last
end
comm.sudo("curl -L https://github.com/docker/compose/releases/download/#{version}/docker-compose-`uname -s`-`uname -m` > #{config.executable_install_path}") The default value for the I would create a pull-request, but i have no idea how to test/debug a vagrant plugin. |
@prilka Thanks for the suggestion! That's a great idea. |
One downside to doing this is it will make using the package unpredictable. If you have a specific version of the plugin installed, over time the version of docker-compose changes, which makes a development environment unpredictable. I'm guessing not a lot of people are pinning vagrant plugin versions though, so this is probably mute, and I'm working on adding |
That's true, but it's the same behavior as with most package-managers (e.g.
nice, thank you 👍 |
I think the approach I'll take is to use the GitHub API, with something akin to the following:
Right now this returns The downside to using the GitHub API is that rate limiting will set in if someone, or the NAT they are behind, is hitting the API a lot. Using the 301/302 redirect on the URL won't have the rate limit. |
The rate limit is really annoying for agencies with a shared ip. The solution with the redirect parsing works well and stable. I use it in some provisioning-scripts for quite a while. |
That's a good point. 👍 |
Is there any way to achieve setting docker-compose version to latest stable? Just like the docker installation defaults to latest stable version.
The text was updated successfully, but these errors were encountered: