Skip to content
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

Fix Dockerfile build issue #8

Merged
merged 1 commit into from
May 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
FROM hexpm/erlang:22.3.4.12-ubuntu-focal-20200703 as ERLANG
FROM hexpm/erlang:22.3.4.12-ubuntu-focal-20200703 as erlang

WORKDIR /app

FROM ERLANG as DOWNLOADER
FROM erlang as downloader

RUN apt update; apt install --yes curl; \
mkdir -p /tmp/tools; \
curl -L https://github.com/erlang/rebar3/releases/download/3.14.4/rebar3 > /tmp/tools/rebar3; \
chmod +x /tmp/tools/*

FROM ERLANG as BUILDER
FROM erlang as builder

COPY --from=DOWNLOADER /tmp/tools/rebar3 rebar3
COPY --from=downloader /tmp/tools/rebar3 rebar3
COPY rebar.config rebar.lock ./
RUN ./rebar3 get-deps

COPY src/ src/
RUN ./rebar3 escriptize; find . -type f -executable

FROM ERLANG as RUNNER
FROM erlang as runner

copy --from=BUILDER /app/_build/default/lib/erl_exercism /opt/erl_exercism
COPY --from=BUILDER /app/_build/default/bin/erlang_test_runner /opt/test-runner/bin/
COPY --from=builder /app/_build/default/lib/erl_exercism /opt/erl_exercism
COPY --from=builder /app/_build/default/bin/erlang_test_runner /opt/test-runner/bin/
COPY run.sh /opt/test-runner/bin/run.sh

ENV ERL_LIBS=/opt/erl_exercism
Expand Down