aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-07-13 11:31:45 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-07-13 11:31:45 -0300
commitfad4f5f61483e30ade917d94e7d015ee1ae961d6 (patch)
tree24ac66cc719594a9f3d5a6507aaa357caf992a97
parent0231ce350fb9cc1048898861e91e29157281a51b (diff)
downloadpadrao-fad4f5f61483e30ade917d94e7d015ee1ae961d6.tar.gz
padrao-fad4f5f61483e30ade917d94e7d015ee1ae961d6.tar.bz2
Boxes
-rw-r--r--boxes.mdwn52
1 files changed, 52 insertions, 0 deletions
diff --git a/boxes.mdwn b/boxes.mdwn
new file mode 100644
index 0000000..0d60428
--- /dev/null
+++ b/boxes.mdwn
@@ -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