File tree Expand file tree Collapse file tree 3 files changed +41
-13
lines changed Expand file tree Collapse file tree 3 files changed +41
-13
lines changed Original file line number Diff line number Diff line change
1
+ **
2
+ ! .pkgx.yaml
3
+ ! lib /** /*
4
+ ! mix.exs
Original file line number Diff line number Diff line change
1
+ FROM pkgxdev/pkgx as base
2
+ # Set locale to utf8, without this Elixir warns:
3
+ # > the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8.
4
+ # > Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)
5
+ # > or set the ELIXIR_ERL_OPTIONS="+fnu" environment variable
6
+ RUN apt-get -y install locales
7
+ RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
8
+ ENV LANG en_US.UTF-8
9
+ ENV LANGUAGE en_US:en
10
+ ENV LC_ALL en_US.UTF-8
11
+
12
+ FROM base as build
13
+ WORKDIR /action/workspace
14
+
15
+ # System dependencies
16
+ COPY ../.pkgx.yaml .
17
+ RUN eval "$(pkgx --internal.activate $PWD)"
18
+
19
+ # Mix dependencies
20
+ COPY ../mix.exs .
21
+ RUN eval "$(pkgx --internal.activate $PWD)" && mix deps.get
22
+
23
+ # Compile
24
+ COPY ../lib lib
25
+ RUN eval "$(pkgx --internal.activate $PWD)" && mix deps.compile
26
+ RUN eval "$(pkgx --internal.activate $PWD)" && mix escript.build
27
+
28
+ FROM base as release
29
+ COPY --from=build /root/.pkgx /root/.pkgx
30
+ COPY --from=build /action/workspace/.pkgx.yaml /usr/local/bin
31
+ COPY --from=build /action/workspace/elixir_script /usr/local/bin
32
+ RUN echo '#!/bin/sh\n \
33
+ eval "$(pkgx --internal.activate /usr/local/bin)"\n \
34
+ exec /usr/local/bin/elixir_script "$@"' > /usr/local/bin/elixir_script_wrapper && \
35
+ chmod +x /usr/local/bin/elixir_script_wrapper
36
+
37
+ ENTRYPOINT ["elixir_script_wrapper" ]
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments