forked from ArkScript-lang/Ark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (37 loc) · 1.07 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM alpine:3.12 AS permissions-giver
WORKDIR /out
FROM alpine:3.12 AS submodule-initializor
# Install git
RUN apk --no-cache add git
WORKDIR /out
COPY .git .git
COPY lib lib
COPY .gitmodules .
# Get submodules and remove unneccesery files
RUN git submodule update --init --recursive \
&& rm -rf `find . -type d -name ".git"` \
&& rm .gitmodules
FROM alpine:3.12 AS builder
# Install cmake
RUN apk --no-cache add cmake clang clang-dev make gcc g++ libc-dev linux-headers
# Build
COPY include include
COPY src src
COPY Installer.iss.in .
COPY CMakeLists.txt .
COPY --from=submodule-initializor /out .
RUN cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DARK_BUILD_EXE=On \
&& cmake --build build --target arkscript
FROM alpine:3.12 AS organizer
# Files needed to run Ark
WORKDIR /out/ark
COPY --from=builder build build
COPY --from=builder include include
COPY --from=builder lib lib
FROM alpine:3.12 AS runner
# Install cmake
RUN apk --no-cache add cmake
# Install Ark
COPY --from=organizer /out/ark .
RUN cmake --install build --config Release
ENTRYPOINT [ "arkscript" ]