Skip to content

Commit b22a0ef

Browse files
authored
[Feature:Autograding] Add Erlang image (#53)
### Please check if the PR fulfills these requirements: * [X] Tests for the changes have been added/updated (if possible) * [X] Documentation has been updated/added if relevant ### What is the current behavior? <!-- List issue if it fixes/closes/implements one using the "Fixes #<number>" or "Closes #<number>" syntax --> N/A ### What is the new behavior? Can now run Erlang files ### Other information? <!-- Is this a breaking change? --> <!-- How did you test --> I tested it using the code below ```erl -module(concurrency). -export([start/0, process/0]). start() -> Pid = spawn(concurrency, process, []), Pid ! {self(), "Hello"}, receive {Pid, Msg} -> io:format("Received message: ~p~n", [Msg]) end. process() -> receive {Sender, Msg} -> Sender ! {self(), Msg} end. ``` ![image](https://github.com/user-attachments/assets/8ee78e7a-5a29-4ecf-8669-348242d45a0d)
1 parent 2f15550 commit b22a0ef

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

dockerfiles/erlang/26/Dockerfile

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Use the base image
2+
FROM ubuntu:22.04
3+
4+
WORKDIR /usr/src/app
5+
ENV LANG=C.UTF-8
6+
ENV DEBIAN_FRONTEND=noninteractive
7+
ENV KERL_BASE_DIR=/usr/local/kerl
8+
9+
# Install dependencies for Erlang and the build process
10+
RUN set -eux; \
11+
apt-get update; \
12+
apt-get install -y --no-install-recommends \
13+
build-essential \
14+
libncurses5-dev libsctp1 \
15+
ca-certificates wget curl git \
16+
autoconf m4 libssl-dev libwxgtk3.0-gtk3-dev libgl1-mesa-dev \
17+
libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop \
18+
locales; \
19+
rm -rf /var/lib/apt/lists/*
20+
21+
# Install kerl to manage Erlang builds
22+
RUN curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl && \
23+
chmod +x kerl && \
24+
mv kerl /usr/local/bin/kerl
25+
26+
# Update kerl releases and build Erlang 26.0
27+
RUN kerl update releases
28+
RUN MAKEFLAGS=-j6 kerl build 26.0 26.0_build
29+
RUN kerl install 26.0_build /usr/local/erlang/26.0
30+
31+
# Cleanup the build files
32+
RUN rm -rf /usr/local/kerl/builds/26.0_build
33+
34+
# Activate the Erlang environment by default
35+
RUN echo ". /usr/local/erlang/26.0/activate" >> /root/.bashrc && \
36+
echo ". /usr/local/erlang/26.0/activate" >> /etc/profile
37+
38+
# Default command
39+
CMD ["/bin/bash"]

dockerfiles/erlang/metadata.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"pushLatest": false
3+
}

0 commit comments

Comments
 (0)