Fl4m3Ph03n1x

Fl4m3Ph03n1x

Setup to develop using elixir

Background

Recently I took upon a personal project to help someone very close to me. This project will be done in Elixir, but there is an issue - the machines I have access to are not strong enough to have a Linux VM (via VirtualBox or VMWare) on top of their installation and run Elixir.

I mention a VM, because I don’t want to install Elixir on the host, which most likely won’t even be my machine.

Options

The first thing that jumped to my mind was to use a cloud provider. However I have to pay them a monthly fee and I don’t feel comfortable with that idea.

The other option I can think of is using Docker. I have read some articles where people mention developer images for Elixir programmers. Ideally, I would be able to have all my code and environment in a docker image and then use an online editor to code and do the work.

Questions

But I have no experience with docker images for development. So naturally I have some questions:

  1. what is your current setup for developing elixir?
  2. Do you use a docker image for development?
  3. Do you install things directly into your machine?
  4. Do you recommend any cloud provider or online IDE that I could try?

Most Liked

NobbZ

NobbZ

What operating system is your host driven by? If it’s not Linux, you’ll end up installing a VM which runs the docker anyway…

eahanson

eahanson

I do my elixir work directly on macOS, but I also work on a larger JVM-based project and we decided to do development on Google Cloud Platform.

We spin up a preemptible instance whenever we want to do work and use Mutagen to sync local files to the remote machine and to forward ports. We then edit files locally and use local web browsers to hit the local ports which get forwarded to the remote machine. An ansible script for setup and few simple bash scripts for starting and stopping everything keeps it all pretty simple.

A 4 CPU machine with 15GB RAM is USD$0.04 per hour (pro-rated to the minute and only accruing charges when the machine is running) which is pretty cheap especially if you’re not going to be using it 24x7. Google might choose to shut your machine down if they need it back (that’s the preemptible part, and the reason why it’s only 20% the price of a regular server) but because all of our work is written to our local disk before being synced up to the remote machine, there’s no risk of data loss.

NobbZ

NobbZ

Docker is not a VM!

But it runs in a linux VM if your host system is windows.

If you use docker4windows then the MS hypervisor is used, it will allocate the necessary memory for the VM on creation, and even if enough is available in the system, chance is that creation of the machine will fail. I had a lot of trouble using it. It never properly worked for me.

Docker Toolbox though uses VirtualBox and memory for the VM is allocated in a more host friendly way, and in general my experience using it was much better than with docker4windows.

So, your best bet is probably USB-boot into a Linux2Go.

This also solves your “I don’t want to install anything” problem.

NobbZ

NobbZ

I in person have absolutely no reason to boot into windows, except to host my development VM at work…

Sadly this is how it is at work. But a VM works better for me than WSL.

Asimov

Asimov

You can use the smallest instance at vultr {dot} com. it gives you 512MB Memory and one CPU. At USD 2.50 a month, it is hard to beat. You have your environmente ready in no more than 10 min. I think Digital Ocean has simmilar offers.

Where Next?

Popular in Questions Top

vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
Exadra37
Sometimes I want to check if the input into a function is not a blank string. My first approach: defmodule Example do def do_stuff(s...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New

We're in Beta

About us Mission Statement