docker-compose V2?
This doesn't work with V2 any more. The download URL has changed, so it simply can't pull it.
/Users/user/.vagrant.d/gems/2.7.6/gems/vagrant-docker-compose-1.5.1/lib/vagrant-docker-compose/installer.rb:55:in `fetch_file':
Error: unable to download docker-compose: https://github.com/docker/compose/releases/download/2.11.0/docker-compose-Linux-x86_64 (RuntimeError)
With v2 the URL is https://github.com/docker/compose/releases/download/v2.11.0/docker-compose-Linux-x86_64 (there's a v in the version. There are probably other issues.
If this project is dead, what's the standard way of provisioning docker compose these days?
@dmt0 I stumbled across the same problem you described here and i figured out a workaround with only using tools provided by vagrant:
Vagrant.configure("2") do |config|
config.vm.define "ubuntu" do |ubuntu|
ubuntu.vm.box = "bento/ubuntu-18.04"
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.cpus = "1"
end
config.vm.synced_folder "./vagrant_data", "/vagrant", SharedFoldersEnableSymlinksCreate: false
config.vm.provision "docker-compose-setup", type: "shell", preserve_order: true, path: "./vagrant_data/docker/install.sh"
config.vm.provision :docker
config.vm.provision "docker-compose-run", type: "shell",preserve_order: true, :run => 'always', path: "./vagrant_data/docker/run.sh"
ubuntu.trigger.before :destroy, :halt do |trigger|
trigger.info = "Stopping container..."
trigger.run_remote = {inline: "cd /vagrant/docker && docker-compose stop"}
end
end
end
the config above should do the same as the plugin, at least it works for me. the install script installs the latest docker-compose version and the run scripts starts the containers on each vagrant up. The trigger ensures the correct stopping of the container.
to fix this problem in the plugin, it is probably enough to updated the value of @compose_version in the config.rb based on its value. But i am not very proficient in ruby and have no dev. env for ruby set up.
@EricKrg Any chance you might share your "./vagrant_data/docker/run.sh" & "./vagrant_data/docker/run.sh" scripts. Would be helpful. Thanks!
@evan108108 sure, https://github.com/EricKrg/vagrant-docker-compose-template/blob/main/vagrant_data/docker/run.sh i made a template project for this.
There is actually not happening a lot in the run.sh, but you might want to update the install.sh with a current version of docker -compose.