-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
68 lines (61 loc) · 1.46 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# syntax=docker/dockerfile:1
FROM ubuntu:18.04 AS base
ENV LD_LIBRARY_PATH="/usr/local/lib/x86_64-linux-gnu"
ENV LUA_CPATH="/app/build/?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/lib/x86_64-linux-gnu/?.so"
ENV LUA_PATH="/app/integration/tests/?.lua;;"
ARG DEBIAN_FRONTEND="noninteractive"
ARG CLANGD_TAG="15.0.6"
ARG STYLUA_TAG="v0.16.0"
ARG SHFMT_TAG="v3.6.0"
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
RUN <<EOF
apt-get -qq -o=Dpkg::Use-Pty=0 update
apt-get -qq -o=Dpkg::Use-Pty=0 install \
git \
boxes \
clang-10 \
clang-format-10 \
make \
cmake \
libssl-dev \
libuv1-dev \
zlib1g-dev \
libluajit-5.1-dev \
luajit \
luarocks \
pkg-config \
valgrind \
gdb \
doxygen \
graphviz
apt-get clean
ln -s /usr/bin/clang-format-10 /usr/bin/clang-format
ln -s /usr/bin/clang-10 /usr/bin/clang
git config --global url.https://.insteadOf git://
luarocks install busted
luarocks install luasocket
luarocks install uuid
luarocks install lua-cassandra
EOF
COPY --from=mvdan/shfmt:v3-alpine /bin/shfmt /usr/bin/shfmt
# COPY --from=ghcr.io/JohnnyMorganz/StyLua:stylua:0.17.0 /stylua /usr/bin/stylua
COPY ./vendor /app/vendor/
WORKDIR /app/vendor/cpp-driver/build
RUN <<EOF
cmake ..
make
make install
EOF
WORKDIR /app
FROM base AS build
COPY . /app/
WORKDIR /app/build
RUN <<EOF
cmake ..
cmake --build .
EOF
WORKDIR /app
RUN ./format.sh
FROM scratch AS artifacts
COPY --from=build /app/build/lucas.so* /
COPY --from=build /app/vendor/cpp-driver/build/libcassandra.so* /