Skip to content

Commit 573c4bf

Browse files
committed
Use asdf to manage Elxir and Erlang
1 parent f11f00e commit 573c4bf

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

chunks/lang-elixir/Dockerfile

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,23 @@ USER root
66
# Dazzle does not rebuild a layer until one of its lines are changed. Increase this counter to rebuild this layer.
77
ENV TRIGGER_REBUILD=1
88

9-
RUN cd /tmp \
10-
&& wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb \
11-
&& dpkg -i erlang-solutions_2.0_all.deb \
12-
&& install-packages elixir
13-
149
USER gitpod
10+
11+
# Install asdf to make it easier to manage elixir versions
12+
#
13+
# Why?
14+
# 1. At the time of this writing, `apt-get install elixir` was installing
15+
# a version that was not compatible with glibc in Ubuntu Focal.
16+
# 2. This makes it explicit as to what versions we're installing.
17+
# 3. It'll give users the ability to easily make changes at runtime to experiment
18+
RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.1
19+
RUN echo ". "$HOME/.asdf/asdf.sh"" >> /home/gitpod/.bashrc.d/100-asdf
20+
RUN echo ". "$HOME/.asdf/completions/asdf.bash"" >> /home/gitpod/.bashrc.d/100-asdf
21+
ENV PATH=/home/gitpod/.asdf/bin:/home/gitpod/.asdf/shims:${PATH}
22+
23+
RUN asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git
24+
RUN asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
25+
RUN asdf install erlang 25.2.2
26+
RUN asdf install elixir 1.13.4-otp-25
27+
RUN asdf global erlang 25.2.2
28+
RUN asdf global elixir 1.13.4-otp-25

tests/lang-elixir.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
command: [elixir,--version]
33
assert:
44
- status == 0
5-
- stdout.indexOf("Erlang/OTP 2") != -1
6-
- stdout.indexOf("Elixir 1.13.") != -1
5+
- stdout.indexOf("Erlang/OTP 25") != -1
6+
- stdout.indexOf("Elixir 1.13.4") != -1

0 commit comments

Comments
 (0)