Answer the question
In order to leave comments, you need to log in
How to specify the desired box version in Vagrantfile?
I do not understand what needs to be done to install the required version of vagrant box for laravel homestead. I added these lines to the Vagrantfile, but version 9.7.2 is still downloaded. Tell me what to do
Answer the question
In order to leave comments, you need to log in
cool_sniper98 - checked everything works for me
here
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
require 'pp'
basedir = ENV.fetch('USERPROFILE', '')
basedir = ENV.fetch('HOME', '') if basedir == ''
basedir = basedir.gsub('\\', '/')
dir = File.expand_path(File.dirname(__FILE__))
box_hostname = ENV.fetch('BOX_HOSTNAME', 'alpine')
box_name = ENV.fetch('BOX_NAME', 'generic/alpine38')
box_version = ENV.fetch('BOX_VERSION', '3.1.20' ) # 3.1.22
VAGRANTFILE_API_VERSION = '2'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = box_name # box_hostname
config.vm.hostname = box_hostname
config.vm.box_version = box_version # v3.1.20
config.ssh.forward_agent = true
config.vm.boot_timeout = 600
config.vm.synced_folder './', '/vagrant'
if ! Vagrant.has_plugin?('vagrant-alpine')
# TODO: raise an error
end
if Vagrant.has_plugin?('vagrant-vbguest')
config.vbguest.auto_update = false
end
config.vm.provision "shell", inline: <<-SHELL
apk update && apk upgrade
SHELL
end
vagrant up
# default: Downloading: https://vagrantcloud.com/generic/boxes/alpine38/versions/3.1.20/providers/virtualbox.box
export BOX_VERSION=3.1.18
vagrant stop ; vagrant destroy -f ; vagrant up
# default: Downloading: https://vagrantcloud.com/generic/boxes/alpine38/versions/3.1.18/providers/virtualbox.box
export BOX_VERSION=3.1.99
vagrant up
The box you're attempting to add has no available version that
matches the constraints you requested. Please double-check your
settings. Also verify that if you specified version constraints,
that the provider you wish to use is available for these constraints.
Box: generic/alpine38
Address: https://vagrantcloud.com/generic/alpine38
Constraints: 3.1.99
Available versions: 1.6.24, 1.6.26, 1.8.0, 1.8.1, 1.8.2, 1.8.4, 1.8.7, 1.8.8, 1.8.9, 1.8.12, 1.8.13, 1.8.14, 1.8.24, 1.8.26, 1.8.27, 1.8.28, 1.8.32, 1.8.38, 1.8.40, 1.8.48, 1.8.50, 1.8.52, 1.8.54, 1.8.56, 1.8.58, 1.8.60, 1.9.2, 1.9.4, 1.9.6, 1.9.8, 1.9.10, 1.9.12, 1.9.14, 1.9.16, 1.9.18, 1.9.19, 1.9.20, 1.9.22, 1.9.24, 1.9.26, 1.9.28, 1.9.30, 1.9.32, 1.9.34, 1.9.36, 1.9.38, 1.9.40, 2.0.0, 2.0.2, 2.0.4, 2.0.6, 3.0.0, 3.0.1, 3.0.2, 3.0.4, 3.0.6, 3.0.8, 3.0.10, 3.0.12, 3.0.14, 3.0.16, 3.0.18, 3.0.20, 3.0.22, 3.0.24, 3.0.26, 3.0.28, 3.0.30, 3.0.32, 3.0.34, 3.0.36, 3.0.38, 3
vagrant box list
generic/alpine38 (virtualbox, 3.1.18)
generic/alpine38 (virtualbox, 3.1.20)
vagrant box remove generic/alpine38 --box-version 3.1.20
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question