-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Erlang OTP on Docker #1075
Conversation
I'm aware of https://hub.docker.com/r/correl/erlang/ which provides additional popular tools like rebar and relx, I will try to add them in more variants once this base can be merged. |
docs PR at docker-library/docs#348 please review |
Does it make sense to consider the pre-built packages hosted by Erlang Solutions, since they are officially recommended by upstream? I admit I don't know nearly enough about the Erlang ecosystem to know whether they're kept well up-to-date. One way of phrasing this that I find helpful is whether a production deployment of an Erlang project is recommended to be compiling Erlang from source, or whether it ought to be downloading pre-built packages from somewhere. I'm also curious as to the number of versions supported here -- are these all still actively receiving updates/fixes upstream? Additionally (as a final point from my initial review), I'm curious whether anyone from upstream is interested in being involved here (and if you've reached out to them, what their thoughts were)? 👍 |
Back when I was working for Synctree and created the Dockerfiles over at |
Looks like I was working with @dexsda |
that's on my schedule, I just made erlang:18-esl variant, to pull install the binary erlang-18.1 deb package from erlang-solutions install on to debian:jessie, which results a smaller image, https://github.com/c0b/docker-erlang-otp/blob/master/18/esl/Dockerfile $ docker images |grep ^erlang
erlang 18.1-esl 138c797adec7 5 days ago 286.9 MB
erlang 18.1 27ad0fc44644 5 days ago 741.5 MB
erlang R16B03-1 e0deec5e1e72 6 days ago 740.2 MB
erlang 18.0.3 52d4a7a4a281 6 days ago 743.7 MB |
I have researched some existing effort like this list, looks like many ones are already on this just haven't communicated yet
$ docker search erlang
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
correl/erlang Erlang/OTP for Docker 14 [OK]
... While I just started from scratch, my goal is to provide images for a few last erlang releases (the last 4), close to full feature erlang, and relatively slim images; https://github.com/c0b/docker-erlang-otp So there are two ways to make images:
Here from my repo I maintained one each for latest 4 erlang releases, (R15, R16, 17, 18), each with different variant, following the best practices from docker official images guideline, should end up with
All these images are almost full featured Erlang-OTP images (except wxwidgets & jinterface), you can run it like this once build locally, $ docker run -it --rm erlang:18.1
Erlang/OTP 18 [erts-7.1] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V7.1 (abort with ^G)
1> uptime(). # the new uptime() shell command since OTP 18
3 seconds
ok
2> application:which_applications().
[{stdlib,"ERTS CXC 138 10","2.6"},
{kernel,"ERTS CXC 138 10","4.1"}]
3>
User switch command
--> q
$ docker run -it --rm erlang:18.1 /bin/bash
root@6d2c1ad52ae8:/# ls /usr/local/lib/erlang/lib/
asn1-4.0 cosProperty-1.2 edoc-0.7.17 gs-1.6 observer-2.1
public_key-1.0.1 stdlib-2.6 xmerl-1.3.8 common_test-1.11
cosTime-1.2 eldap-1.2 hipe-3.13 orber-3.8 reltool-0.7
syntax_tools-1.7 compiler-6.0.1 cosTransactions-1.3
erl_docgen-0.4 ic-4.4 os_mon-2.4 runtime_tools-1.9.1
test_server-3.9 cosEvent-2.2 crypto-3.6.1 erl_interface-3.8
inets-6.0.1 ose-1.1 sasl-2.6 tools-2.8.1 cosEventDomain-1.2
debugger-4.1.1 erts-7.1 kernel-4.1 otp_mibs-1.1 snmp-5.2
typer-0.9.9 cosFileTransfer-1.2 dialyzer-2.8.1 et-1.5.1
megaco-3.18 parsetools-2.1 ssh-4.1 webtool-0.9 cosNotification-1.2
diameter-1.11 eunit-2.2.11 mnesia-4.13.1 percept-0.8.11
ssl-7.1 wx-1.5
root@4cfd3172e8cc:/# ls /usr/local/lib/erlang/lib/ | wc -l
50 Size: $ docker images |grep ^erlang
erlang 18.1-esl 138c797adec7 5 days ago 286.9 MB
erlang 18.1 27ad0fc44644 5 days ago 741.5 MB
erlang R16B03-1 e0deec5e1e72 6 days ago 740.2 MB
erlang 18.0.3 52d4a7a4a281 6 days ago 743.7 MB Comments are welcome. |
f7c6d70
to
090afd0
Compare
there are not much discussions yet, while I got -esl variant: $ docker images |awk 'NR == 1 || /^erlang/'
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
erlang 18.1-esl 9140e1a9913e 3 days ago 286.9 MB
erlang 18.1 f4ea1ad78f3f 3 days ago 741.5 MB
erlang R16B03-1 46fe912a808c 3 days ago 737.9 MB
erlang 17.5 5b01e12ab52e 3 days ago 741 MB
erlang 18.0.3 52d4a7a4a281 10 days ago 743.7 MB http://erlang.org/pipermail/erlang-questions/2015-October/thread.html#86266 |
/cc @rvirding hi Robert, could you comment here? as Compile from erlang-otp source code, vs install binaries from erlang-solutions, what is the preferred way? |
when Robert Virding comes here in LA in this week for a training as Principal Language Expert @ Erlang Solutions I had a little conversation asked him to comment on this, while he may not have time to comment here, I just quote his words when I asked "Compile from erlang-otp source code, vs install binaries": /cc @rvirding
[1] https://www.erlang-solutions.com/about/news/erlang-solutions-announces-appointment-robert-virding-principal-language-expert |
That sounds to me like we don't gain much by compiling from source in this case? 😄 👍 |
Comparing to Python and Golang, python docker is always compiling from source code, because python.org not providing precompiled binaries (for Linux), while golang docker is installing binaries from golang.org if because that language team is officially providing in binaries; I think here it's the same, erlang.org doesn't provide precompiled binaries either; although the commercial Erlang-Solutions Inc provided good binaries, but compile from source code still has the benefits of flexibility and support in time. have gcc in the image would be good for linkedin drivers written in C. |
At the moment, the erlang version at the apt repo (from packages.erlang-solutions.com) doesn't seem to be up to date with [https://github.com/erlang/otp/releases]... This make the case for building from source, doesn't it? It would be very convenient to just install 'erlang-nox' from the debian repo, but again, it doesn't seem to be up to date. |
@c0b: Sent you a PR: "Feature: Improved variant names and builds", which should help :) |
I agree, I can remove R15 / R16 from |
d21a53c
to
f63ba4e
Compare
@c0b What happened to the LANG env var? I recall read somewhere that everything goes to funk if isn't set... but I'm not sure... |
in my elixir implementation, that is the one really requiring utf-8, otherwise would give a warning; but the default erlang doesn't require that, the erlang default encoding is latin1 I think, and it works fine without LANG. |
|
||
17.5.6.4: git://github.com/c0b/docker-erlang-otp@7a86ea4d35b99d1c40a9f2fe1470615e096c952a 17 | ||
17.5: git://github.com/c0b/docker-erlang-otp@7a86ea4d35b99d1c40a9f2fe1470615e096c952a 17 | ||
17: git://github.com/c0b/docker-erlang-otp@7a86ea4d35b99d1c40a9f2fe1470615e096c952a 17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this PR is updated with one last version for 18 / 17 release only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you want to bump this one more time before we merge to include some of these other changes? erlang/docker-erlang-otp@7a86ea4...master
Coo �@c0b :) I was about to make another PR with rebar on it, but you already nailed it :) |
The Dockerfiles look fine to me. And it looks like you contacted upstream on the mailing list, but there was not much response. It might be interesting if msaraiva wanted to join you in maintaining the images with his slim ones based on Alpine Linux or maybe those should be part of the Elixir discussion (up to you, but he seems to be already maintaining them and it might be useful to users). LGTM, Build test of #1075; f63ba4e ( $ url="https://raw.githubusercontent.com/docker-library/official-images/f63ba4e28455b6143a8a7478e52e92828eab654a/library/erlang"
$ bashbrew build "$url"
Cloning erlang (git://github.com/c0b/docker-erlang-otp) ...
Processing erlang:18.1.3 ...
Processing erlang:18.1 ...
Processing erlang:18 ...
Processing erlang:latest ...
Processing erlang:17.5.6.4 ...
Processing erlang:17.5 ...
Processing erlang:17 ...
$ bashbrew list --uniq "$url" | xargs test/run.sh
testing erlang:18.1.3
'utc' [1/4]...passed
'cve-2014--shellshock' [2/4]...passed
'no-hard-coded-passwords' [3/4]...passed
'override-cmd' [4/4]...passed
testing erlang:17.5.6.4
'utc' [1/4]...passed
'cve-2014--shellshock' [2/4]...passed
'no-hard-coded-passwords' [3/4]...passed
'override-cmd' [4/4]...passed |
/cc @msaraiva |
It sounds interesting but there's a couple of things we should have in mind:
|
sure it should be shared maintained, if this can be merged and create a repo under link to musl libc is not what I am familiar. are there many docker images using it, and looks like its main consideration is code size, and targeting is embedded area? are there many success stories outside of embedded area, and how about mature level / compatibility review / performance benchmark comparison to other libc implementations for an official image for study purpose, may be still better to link with default glibc? |
There are a number of images that have |
(more directly, I agree with @c0b that for now, we should probably stick to glibc and think about alpine as a potential future endeavor) |
I agree with @tianon. For now, it's better to stick with glibc for the official image. |
ec79293
to
862b66d
Compare
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
updated |
LGTM, Build test of #1075; 51334cd ( $ url="https://raw.githubusercontent.com/docker-library/official-images/51334cd945f4a94a07ca6d79702a902ff39f914a/library/erlang"
$ bashbrew build "$url"
Fetching erlang (git://github.com/c0b/docker-erlang-otp) ...
Processing erlang:18.1.3 ...
Processing erlang:18.1 ...
Processing erlang:18 ...
Processing erlang:latest ...
Processing erlang:17.5.6.4 ...
Processing erlang:17.5 ...
Processing erlang:17 ...
$ bashbrew list --uniq "$url" | xargs test/run.sh
testing erlang:18.1.3
'utc' [1/4]...passed
'cve-2014--shellshock' [2/4]...passed
'no-hard-coded-passwords' [3/4]...passed
'override-cmd' [4/4]...passed
testing erlang:17.5.6.4
'utc' [1/4]...passed
'cve-2014--shellshock' [2/4]...passed
'no-hard-coded-passwords' [3/4]...passed
'override-cmd' [4/4]...passed |
LGTM 👍 |
Support for Erlang OTP on Docker
Nice! then how about docker-library/docs#348 ? and what else I can do to make it appearing at ? |
It has to build and push on the official server before it shows up there,
but as soon as it's done it'll go out.
We're taking a look at the docs now.
|
There is no official erlang images yet, I'm trying to make it happen; please let me know if any additional work need to do
+This is used as docker base image for Erlang OTP.
+
+One latest version for each of Last four major version: 18, 17, R16, R15 will be supported.
http://www.erlang.org/download.html
Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability.