forked from SchoolOfFreelancing/wire-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.prebuilder
46 lines (40 loc) · 1.47 KB
/
Dockerfile.prebuilder
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
# Requires docker >= 17.05 (requires support for multi-stage builds)
FROM alpine:3.11 as cryptobox-builder
# compile cryptobox-c
RUN apk add --no-cache cargo file libsodium-dev git && \
cd /tmp && \
git clone https://github.com/wireapp/cryptobox-c.git && \
cd cryptobox-c && \
export SODIUM_USE_PKG_CONFIG=1 && \
cargo build --release
FROM alpine:3.11
# install cryptobox-c in the new container
COPY --from=cryptobox-builder /tmp/cryptobox-c/target/release/libcryptobox.so /usr/lib/libcryptobox.so
COPY --from=cryptobox-builder /tmp/cryptobox-c/src/cbox.h /usr/include/cbox.h
# development packages required for wire-server Haskell services
RUN apk add --no-cache \
alpine-sdk \
ca-certificates \
linux-headers \
zlib-dev \
ghc \
ghc-dev \
ghc-doc \
libsodium-dev \
openssl-dev \
protobuf \
icu-dev \
geoip-dev \
snappy-dev \
llvm-libunwind-dev \
bash \
xz \
libxml2-dev \
git \
ncurses \
sed
# get static version of Haskell Stack and use system ghc by default
ARG STACK_ALPINE_VERSION=2.3.1
RUN curl -sSfL https://github.com/commercialhaskell/stack/releases/download/v${STACK_ALPINE_VERSION}/stack-${STACK_ALPINE_VERSION}-linux-x86_64-static.tar.gz \
| tar --wildcards -C /usr/local/bin --strip-components=1 -xzvf - '*/stack' && chmod 755 /usr/local/bin/stack && \
stack config set system-ghc --global true