]> gitweb.fluxo.info Git - padrao.git/commitdiff
Boxes
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 13 Jul 2015 14:31:45 +0000 (11:31 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 13 Jul 2015 14:31:45 +0000 (11:31 -0300)
boxes.mdwn [new file with mode: 0644]

diff --git a/boxes.mdwn b/boxes.mdwn
new file mode 100644 (file)
index 0000000..0d60428
--- /dev/null
@@ -0,0 +1,52 @@
+[[!toc levels=4]]
+
+Boxes
+=====
+
+Necessidade
+-----------
+
+* Ambiente de desenvolvimento ágil.
+* Que permita executar de forma isolada aplicações sem auditoria ou checagem de integridade.
+
+Criando uma base box
+--------------------
+
+* [Creating a Base Box - Vagrant Documentation](https://docs.vagrantup.com/v2/boxes/base.html).
+* [Creating a Base Box - VirtualBox Provider - Vagrant Documentation](https://docs.vagrantup.com/v2/virtualbox/boxes.html).
+
+### Configuração do sudo
+
+Usamos algo mais recomendado ao invés de mexer no `/etc/sudoers` do pacote:
+
+    echo "vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant
+    chown root.root /etc/sudoers.d/vagrant
+    chmod 0440 /etc/sudoers.d/vagrant
+
+### Workarounds
+
+A mensagem de erro [stdin: is not a tty](https://github.com/mitchellh/vagrant/issues/1673) é corrigida
+com isto no `/root/profile`:
+
+    tty -s && mesg n
+
+Encolhendo uma máquina virtual
+------------------------------
+
+  * https://superuser.com/questions/529149/how-to-compact-virtualboxs-vdi-file-size
+  * http://www.thelinuxdaily.com/2010/02/shrinking-a-dynamic-virtualbox-disk-image/
+  * https://packages.debian.org/wheezy/zerofree
+  * https://unix.stackexchange.com/questions/42015/mount-is-busy-when-trying-to-mount-as-read-only-so-that-i-can-run-zerofree
+
+Procedimento genérico, dentro da máquina virtual:
+
+    hydractl upgrade clean
+    apt-get install zerofree
+    telinit 1
+    mount -o remount,ro /
+    zerofree /dev/sda1
+    halt
+
+Fora da máquina:
+
+    VBoxManage modifyhd --compact /var/cache/virtualbox/$box/$box.vdi