Vagrant Alpine LinuxLast update: 3 years ago Tag : vagrant, alpine, rails
Wow, almost nine months dude...
Why vagrant and not docker? I'm using Mavericks, dude, and love simplicity, just one box and no setting, just vagrant up and ready. I use docker for another things, just not for my local development...
Why Alpine? Why not the popular Ubuntu based box?
Simple: Size and resource consumption.
Alpine linux is very small and light and fast. It only took a minute or two to download and setup a base box from scratch.
Anyway, here are some caveats of this very Linux:
- No VBGA yet for synchronisation, and I think will never be (VirtualBox Guest Addition). Compile VBGA in Alpine linux is nearly impossible, though I never try :D. Some people says use NFS, but nada! It has to use private network and in my case, still not working.
- My solution is using vagrant-sshfs plugin (
vagrant plugin install vagrant-sshfs)
Vagrantfile, synced_folder condif, dd/change type: to
- In Apline linux, you must install sshfs package (and all its dependencies). Also important to note that you need to load fuse module to mount host folder. (
echo fuse >> /etc/modules# as root)
- I'm using this box for learning Rails 5, so I need to install these:
build-base, ruby-dev, libxml2-devand all its dependencies. Usually if you don't install these development packages, you can't compile and install
nokogiri, which is required by
rails 5. You also need
redis, postgresql/mariadb, and sqliteto begin to experiment with.
- Why Rails 5? Its ActionCable and Turbolinks are rocks!
- Why not Elixir/Phoenix/Go/Node? Its learning curve...
- Vagrant up/reload slightly/noticeably slower than other boxes with VBGA. No problem for me, I have a plenty of time...
Rails 5 can be installed, but actually any problem with
rb-inotify, so currently a no go for alpine linux to handle
Rails 5. Sad!