From 51334cd945f4a94a07ca6d79702a902ff39f914a Mon Sep 17 00:00:00 2001 From: Derek Date: Fri, 11 Sep 2015 00:00:00 +0830 Subject: [PATCH] Support for Erlang OTP on Docker One latest version for each of Last two major releases supported, right there are 18.1, 17.5 from erlang otp releases: https://github.com/erlang/otp/releases --- library/erlang | 10 ++++++++++ test/config.sh | 3 +++ test/tests/erlang-hello-world/expected-std-out.txt | 1 + test/tests/erlang-hello-world/hello-world.erl | 6 ++++++ test/tests/erlang-hello-world/run.sh | 8 ++++++++ 5 files changed, 28 insertions(+) create mode 100644 library/erlang create mode 100644 test/tests/erlang-hello-world/expected-std-out.txt create mode 100644 test/tests/erlang-hello-world/hello-world.erl create mode 100755 test/tests/erlang-hello-world/run.sh diff --git a/library/erlang b/library/erlang new file mode 100644 index 0000000000000..47a09a757ec2f --- /dev/null +++ b/library/erlang @@ -0,0 +1,10 @@ +# maintainer: denc716@gmail.com (@c0b) + +18.1.3: git://github.com/c0b/docker-erlang-otp@70fd1e32745cbc68e894d340b105f30b387966c8 18 +18.1: git://github.com/c0b/docker-erlang-otp@70fd1e32745cbc68e894d340b105f30b387966c8 18 +18: git://github.com/c0b/docker-erlang-otp@70fd1e32745cbc68e894d340b105f30b387966c8 18 +latest: git://github.com/c0b/docker-erlang-otp@70fd1e32745cbc68e894d340b105f30b387966c8 18 + +17.5.6.4: git://github.com/c0b/docker-erlang-otp@70fd1e32745cbc68e894d340b105f30b387966c8 17 +17.5: git://github.com/c0b/docker-erlang-otp@70fd1e32745cbc68e894d340b105f30b387966c8 17 +17: git://github.com/c0b/docker-erlang-otp@70fd1e32745cbc68e894d340b105f30b387966c8 17 diff --git a/test/config.sh b/test/config.sh index a080cfc0d9b40..690678b0db9c5 100644 --- a/test/config.sh +++ b/test/config.sh @@ -42,6 +42,9 @@ imageTests+=( [elasticsearch]=' elasticsearch-basics ' + [erlang]=' + erlang-hello-world + ' [gcc]=' gcc-c-hello-world gcc-cpp-hello-world diff --git a/test/tests/erlang-hello-world/expected-std-out.txt b/test/tests/erlang-hello-world/expected-std-out.txt new file mode 100644 index 0000000000000..980a0d5f19a64 --- /dev/null +++ b/test/tests/erlang-hello-world/expected-std-out.txt @@ -0,0 +1 @@ +Hello World! diff --git a/test/tests/erlang-hello-world/hello-world.erl b/test/tests/erlang-hello-world/hello-world.erl new file mode 100644 index 0000000000000..0989061216118 --- /dev/null +++ b/test/tests/erlang-hello-world/hello-world.erl @@ -0,0 +1,6 @@ +#!/usr/bin/env escript + +-module('hello-world'). + +main(_) -> + io:format("Hello World!~n"). diff --git a/test/tests/erlang-hello-world/run.sh b/test/tests/erlang-hello-world/run.sh new file mode 100755 index 0000000000000..e0d82df346d51 --- /dev/null +++ b/test/tests/erlang-hello-world/run.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +image="$1" +dirTest="$(dirname "$(readlink -f "$BASH_SOURCE")")" +dirContainer='/usr/src/erlang' + +docker run --rm -v "$dirTest":"$dirContainer":ro -w "$dirContainer" "$image" escript hello-world.erl