What’s the correct way to install an erlang and elixir environment? I’m using in my daily work, and I’d like to have it in the host and not in a ubuntu distrobox.
@gtaranti According to official guide, Installing Elixir - The Elixir programming language, you can use the version managers asdf
and kerl
. Both asdf
and kerl
can be installed using brew
, Command Line | Bluefin.
(Edit) According to the same installation guide, you could directly install using brew
:
brew install elixir
It is the recommended way for macOS, but it also works for brew
on Linux as we have preinstalled on Bluefin.
Thank @mheuvel-dev , but unfortunately the asdf’s erlang plugin has other dependencies :
apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk
I’ve tried that but stalled.
Just realized we can directly use brew
I’ll try it right now…!
The brew
approach is not bad. But the versions of things usually lag behind what I need for development.
For a different point of view, I create custom OCI images for all my different tool chains. I do this so that I can use them in distrobox
and / or devcontainer
.
I haven’t used elixir or erlang (last for Rabbit MQ) in quite a while, but if I did I would create a fedora-erlang-dx
image.
I wrote an article here and published the article and samples to a repo at:
Enjoy!
Thanks @klmcw .
The brew installation required these dependencies for erlang!
Brew just completed installing erlang. The :observer.start() is broken due to wxwidgets .
I’m going to check out @klmcw solution now.
Thanks.
I saw your guide earlier this week. Really nice demonstration and thanks for sharing.
A Distrobox Fedora container matching your host version with Erlang and Elixir built from source is probably your most host-compatible option.
Hey @klmcw , I’ve tried your solution but I’m stuck at the final stage of assembling the distrobox. I’ve modified the ocisictl.yaml, distrobox.ini and added a Container.fedora-elixir file.
The fedora-base, fedora-elixir and fedora-elixir-dx images have been created OK by docker.
In the assemble stage the distrobox cannot find the fedora-elixir-dx image and trying to pull from other registries
DBX_CONTAINER_ALWAYS_PULL=0 distrobox assemble create --replace --name fedora-elixir-dx
- Deleting fedora-elixir-dx...
Error: no such container fedora-elixir-dx
Error: no such container fedora-elixir-dx
Cannot find container fedora-elixir-dx.
- Creating fedora-elixir-dx...
? Please select an image:
▸ registry.fedoraproject.org/fedora-elixir-dx:latest
registry.access.redhat.com/fedora-elixir-dx:latest
docker.io/library/fedora-elixir-dx:latest
What am I missing here?
are you using docker or podman? I am not sure it should matter, but I am using docker because of devcontainers.
Also, when you do docker image ls -a
or podman image ls -a
does it show latest as the tag? And does distrobox.ini have the tag specified?
For example - latest is specified here:
[fedora-python-dx]
image=fedora-python-dx:latest
...
So in your case:
[fedora-elixir-dx]
image=fedora-elixir-dx:latest
...
The distrobox have the :latest tag specified, but the docker images have not
docker image ls -a
REPOSITORY TAG IMAGE ID CREATED SIZE
vsc-new-bas-3e44dfb653070fbfcb90fb5759dd4009fc9db23fd6d648ed99ba6fa755592298-uid latest 71146ee0d0f4 2 minutes ago 3.8GB
fedora-elixir-dx latest af0a9bfc8e54 2 hours ago 3.8GB
fedora-elixir latest 8dc6a41ea3f2 2 hours ago 3.8GB
fedora-dev-base latest c2ba9fac4213 2 hours ago 2.96GB
Edit: Sorry, docker also has latest..
Let me try to reproduce when I get back from lunch with my wife.
Please do reply here if you find the answer.
Look carefully at the spelling in distrobox.ini. Although, if you are like me you copy/pasted, look for extra spaces at the end of the lines.
You can post an issue in my repo to continue there if you like.
Please double check your distrbox.ini file. This is what I see when I run for my python distrobox:
DBX_CONTAINER_ALWAYS_PULL=0 distrobox assemble create --replace --name fedora-python-dx
- Deleting fedora-python-dx...
Error response from daemon: No such container: fedora-python-dx
Error response from daemon: No such container: fedora-python-dx
Cannot find container fedora-python-dx.
- Creating fedora-python-dx...
Creating 'fedora-python-dx' using image fedora-python-dx:latest [ OK ]
Distrobox 'fedora-python-dx' successfully created.
The key to making that work was 2 things:
- image: fedora-python-dx:latest - must have the tag specified
- use DBX_CONTAINER_ALWAYS_PULL=0 to force using the local registry as is
Can you share the distrobox.ini and ocisictl.yaml file entries for your fedora-elixir-dx target distrobox?
Note I did try to reproduce by just copying some of my existing entries … but that is not that much help.
The last time I saw that prompt for registry was before I put the DBX_CONTAINER_ALWAYS_PULL=0 variable assignment in place ON THE SAME LINE as distrobox assemble. That is important too. If you put the variable assignment on its own line then you will need to export it for distrobox to pick it up.
The other reason it may not have found the image is if there was an error trying to build it.
Have a good weekend and I’ll keep monitoring for your reply either here or in the repo.
Thanks for sharing and keep trying to solve this.
This is my distrobox.ini
[fedora-elixir-dx]
image=fedora-elixir-dx:latest
init=false
# init_hooks=
nvidia=true
pull=0
root=false
start_now=false
home=/var/home/gt
exported_bins="erl erlc escript epmd emem rebar3 elixir elixirc iex mix start_erl to_erl run_erl typer erl_call dialyzer ct_run etop"
exported_bins_path="/var/home/gt/.local/bin"
and this is ocisictl.yaml
# ocisictl.yaml
# order *is* significant in this file
# order here establishes processing order
- name: fedora-dev-base
path: fedora
enabled: true
- name: fedora-elixir
path: fedora
enabled: true
- name: fedora-elixir-dx
path: fedora
enabled: true
assemble: true
I’m using the ocisoctl tool, which I haven’t touch it, except comment out the last clean_imgs command, just in case this was the reason for not finding the image.
I’l be out all day today, but I’ll try anything you suggest when I come back home.
Thanks again.
Edit: The images are created correctly because I can see them in docker images.
Some progress here:
#* ----------------------------------------------------------------------
Creating fedora-elixir-dx ... done.
#* ----------------------------------------------------------------------
#* ----------------------------------------------------------------------
Assembling fedora-elixir-dx ...
#* ----------------------------------------------------------------------
DBX_CONTAINER_ALWAYS_PULL=0 distrobox assemble create --replace --name fedora-elixir-dx
- Deleting fedora-elixir-dx...
Error response from daemon: No such container: fedora-elixir-dx
Error response from daemon: No such container: fedora-elixir-dx
Cannot find container fedora-elixir-dx.
- Creating fedora-elixir-dx...
Creating 'fedora-elixir-dx' using image fedora-elixir-dx:latest [ OK ]
Distrobox 'fedora-elixir-dx' successfully created.
To enter, run:
distrobox enter fedora-elixir-dx
Successfully copied 2.56kB to /tmp/fedora-elixir-dx.os-release
Starting container... [ OK ]
Installing basic packages... [ OK ]
Setting up devpts mounts... [ OK ]
Setting up read-only mounts... [ OK ]
Setting up read-write mounts... [ OK ]
Setting up host's sockets integration... [ OK ]
Setting up host's nvidia integration... [ OK ]
Integrating host's themes, icons, fonts... [ OK ]
Setting up distrobox profile... [ OK ]
Setting up sudo... [ OK ]
Setting up kerberos integration... [ OK ]
Setting up user's group list... [ OK ]
Setting up existing user... [ OK ]
Ensuring user's access... [ OK ]
Setting up skel... [ OK ]
Container Setup Complete!
/usr/bin/erl from fedora-elixir-dx exported successfully in /var/home/gt/.local/bin.
OK!
/usr/bin/erlc from fedora-elixir-dx exported successfully in /var/home/gt/.local/bin.
OK!
/usr/bin/escript from fedora-elixir-dx exported successfully in /var/home/gt/.local/bin.
OK!
/usr/bin/epmd from fedora-elixir-dx exported successfully in /var/home/gt/.local/bin.
OK!
/usr/bin/elixir from fedora-elixir-dx exported successfully in /var/home/gt/.local/bin.
OK!
/usr/bin/elixirc from fedora-elixir-dx exported successfully in /var/home/gt/.local/bin.
OK!
/usr/bin/iex from fedora-elixir-dx exported successfully in /var/home/gt/.local/bin.
OK!
/usr/bin/mix from fedora-elixir-dx exported successfully in /var/home/gt/.local/bin.
OK!
/usr/bin/to_erl from fedora-elixir-dx exported successfully in /var/home/gt/.local/bin.
OK!
/usr/bin/run_erl from fedora-elixir-dx exported successfully in /var/home/gt/.local/bin.
OK!
/usr/bin/typer from fedora-elixir-dx exported successfully in /var/home/gt/.local/bin.
OK!
/usr/bin/dialyzer from fedora-elixir-dx exported successfully in /var/home/gt/.local/bin.
OK!
/usr/bin/ct_run from fedora-elixir-dx exported successfully in /var/home/gt/.local/bin.
OK!
#* ----------------------------------------------------------------------
Assembling fedora-elixir-dx ... done.
#* ----------------------------------------------------------------------
BUT, distrobox list
does not show the fedora-elixir-dx !?
So I cannot use it this entering in the terminal, nor in the .devcontainer I’ve created for vscode.
Additionall, running an exported binary (for example iex) I get :
❯ iex
Error: no such container fedora-elixir-dx
Create it now, out of image registry.fedoraproject.org/fedora-toolbox:latest? [Y/n]:
There is the hint, I believe. It’s confusing because your other output shows signs of your user being in the docker group.
I think the answer is going to be you have an error in your Containerfile.fedora-elixir or the base image does not fulfill the assumptions my Containerfile.img-dx file makes and that is error-ing out.
Either way, I will take the pieces you have given me and see if there are any other clues there.
Enjoy your weekend.
Hey!
docker images ls -a
shows the newly created images fedora-dev-base, fedora-elixir & fedora-elixir-dx
I’v run ujust dx-group
again and rebooted.
And I can create distroboxes manually (ubunutu, fedora, etc)
Next step is to try to assemble the distrobox manually.
(I haven’t done it again)
your yaml entry has assemble: true
. It will do that for you.
Just run ocisictl
(without --prune) again. That will pick up from where you left off.
Cool. glad to hear you are making progress.
TIP: I create an alias for myself named box
to wrap the enter command line. Each time I switch projects, I modify that alias so it points to the distrobox for that project.
alias box='distrobox enter -a --env=HOSTNAME=fedora-python-dx fedora-python-dx -- bash'