rebar3 compile dependencies separated from project code

rtp rtp11@REDACTED
Sat Nov 23 11:04:40 CET 2019


Found a solution just now :-D

Just copy only the rebar.conf-file in a first step and compile it (I
didn't expect to work ... but it does) :

   FROM erlang:22

   WORKDIR /BUILD/

   # get deps in a first step - to use cache in next build ;-)

   COPY erlang/aw/rebar.config .
   RUN rebar3 compile

   # now get whole code

   COPY erlang/aw/ .
   RUN rebar3 as prod tar


Perhaps it helps someone :-)

Cheerio

Ralf


On 23.11.19 10:47, rtp wrote:
> Hi,
>
> I'm build up a docker pipeline for a erlang project.  Currently I build
> the whole project in a new erlang-Docker-Container by a
>
> 	rebar3 as prod tar
>
> This task downloads and compiles the dependencies every time I build;
> because the erlang-container is plain and empty.
>
> I can now call a
>
> 	rebar3 get-deps
>
> in a previous container (or step) to get rid of the downloads.
>
> But I want to get a step further an compile the dependencies before
> building the application, to compile only the app-code and to make the
> build faster.
>
> Does anybody know how to compile dependencies separated from app-code ?
>
> I can't find anything.  Perhaps there's a plugin I don't know!?
>
>
> Thanks a lot
>
> Ralf
>



More information about the erlang-questions mailing list