Vagrantfile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. Vagrant.configure("2") do |config|
  2. config.vm.box = "generic/ubuntu2004"
  3. config.vm.hostname = "apptainer"
  4. config.vm.synced_folder "./", "/vagrant"
  5. config.vm.provider "virtualbox" do |vb|
  6. vb.memory = 8192
  7. vb.cpus = 4
  8. end
  9. config.vm.provider :libvirt do |libvirt|
  10. libvirt.cpus = 4
  11. libvirt.memory = 8192
  12. end
  13. config.vm.provision "shell", inline: <<-SHELL
  14. # Apptainer installation instructions
  15. # https://github.com/apptainer/apptainer/blob/main/INSTALL.md
  16. #
  17. # Install Apptainer dependencies
  18. apt-get update
  19. apt-get install -y \
  20. build-essential \
  21. libssl-dev \
  22. uuid-dev \
  23. libgpgme11-dev \
  24. squashfs-tools \
  25. libseccomp-dev \
  26. wget \
  27. pkg-config \
  28. cryptsetup
  29. apt-get clean
  30. #
  31. # Install GO
  32. export GOVERSION=1.17.7 OS=linux ARCH=amd64
  33. wget -O go${GOVERSION}.${OS}-${ARCH}.tar.gz https://dl.google.com/go/go${GOVERSION}.${OS}-${ARCH}.tar.gz
  34. tar -C /opt -xzf go${GOVERSION}.${OS}-${ARCH}.tar.gz
  35. rm go${GOVERSION}.${OS}-${ARCH}.tar.gz
  36. export PATH=$PATH:/opt/go/bin
  37. #
  38. # Get Apptainer release
  39. export VERSION=1.0.0
  40. wget https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer-${VERSION}.tar.gz
  41. tar -xzf apptainer-${VERSION}.tar.gz
  42. #
  43. # Build/install Apptainer
  44. cd apptainer-${VERSION}
  45. ./mconfig
  46. make -C builddir
  47. make -C builddir install
  48. cd ../
  49. rm -r apptainer-${VERSION} apptainer-${VERSION}.tar.gz
  50. SHELL
  51. end