tonini/alchemist.el

Add ability to compile and run tests inside Docker container

dcaixinha opened this issue · 0 comments

It would be great to be able to use alchemist inside a Docker container. I've read the important note on the Basic Usage page, which states that you can compile a project given that the path inside the container is the same as in the host.

This workflow has some issues, namely Docker changes the owner of certain folders (e.g. _build) every time I go inside the actual container to compile and/or run the tests.

Copying the idea from RSpec Mode, maybe alchemist could have some parameters (such as alchemist-use-docker-when-possible, alchemist-docker-container, alchemist-docker-command and rspec-docker-cwd) which would essentially turn the Elixir / IEx / Mix commands prepended by docker exec -it <alchemist-docker-container> bash -c "cd <alchemist-docker-cwd> && <alchemist-elixir-command ".

This workflow requires that the Docker containers are already up before running any command, but this has the advantage of running other commands (e.g. mix phx.server) inside the container as well.

What do you think?