bullseye-backports is enabled by default on the images from Vagrant
Cloud. So, I can use with -t
or --target-release
flag–I prefer
longer version in scripts. I have the following Vagrantfile
to
maintain this website:
Vagrant.configure('2') do |config|
config.vm.box = 'debian/bullseye64'
config.vm.provision :shell, inline: <<-SHELL
apt-get update
apt-get install --yes make lftp docker.io
apt-get install --yes --target-release bullseye-backports hugo
SHELL
config.vm.provision :docker do |container|
container.run 'miniflux', image: 'docker.io/miniflux/miniflux:2.0.37', args: %w[
--env DATABASE_URL='postgres://potato:potato@192.168.121.1:5432/potato_production'
--env RUN_MIGRATIONS=1
--env LISTEN_ADDR=0.0.0.0:8080
-p 8080:8080
].join(' ')
end
end
Since, Debian Buster is not getting “feature” updates for a while, I wanted to move to newer version of Debian. I need to put a note in here that I do not store data in virtual machine, so therefore, I can easily delete it and upgrade the machine. With this idealogy, I can easily get new machines.
I also apply the same idea to infrastructures that I am managing. Data resides in one machine and others are nukeable.
Now, time to delete our virtual machine with:
vagrant destroy --force
I use force because I don’t want to answer the prompt.
Now, I need to make a small but pretty straightforward change in the
Vagrantfile
.
Vagrant.configure('2') do |config|
- config.vm.box = 'debian/bullseye64'
+ config.vm.box = 'debian/buster64'
# ...
end
At this point, I could run the following to make everything up and running. I want to run the first line because I have multiple Vagrant boxes in my machine, so, I don’t want to snapshot older version of the image. The second command is also straightforward.
vagrant box update
vagrant up
In the machine, I run Miniflux. It connects to PostgreSQL that is
installed in the host machine. So, I don’t need additional
configuration other than setting up DATABASE_URL
.
Vagrant.configure('2') do |config|
# ...
config.vm.provision :docker do |container|
- container.run 'miniflux', image: 'docker.io/miniflux/miniflux:2.0.37', args: %w[
+ container.run 'miniflux', image: 'docker.io/miniflux/miniflux:2.0.41', args: %w[
# ...
]
end
# ...
end
Because I have done this processes later on (I prefer upgrading one
thing at a time), I need to manually upgrade the Docker container with
--provision-with
flag.
vagrant provision --provision-with docker
Just two lines of changes, I can have newer version of software. I can
also do the same thing when I want to test something on testing
branch
of Debian.