You may consider it heresy to use Docker like Vagrant however hear me out. This setup provides us a number of benefits:
- We treat Docker as a virtual machine which make it easier to reason about, you know there is only one Docker container in use for the application at all times
- By default we need to SSH into the Docker container with
make ssh
which then means subsequent command runs don't require Docker to initialise - We can stay logged into Docker so re-running tests is faster, and we can run specific tests, unlike
make test
- We no longer have to prefix commands in documentation with
bin/docker_run bundle exec rspec
instead we say make sure you are logged into the Docker container and then run commands as normal - It also means help on Stackoverflow can be followed more easily without needing to prefix things with
bin/docker_run
- PID issue no longer happens as you're always in the shell session that booted rails