-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (30 loc) · 1.25 KB
/
Dockerfile
File metadata and controls
40 lines (30 loc) · 1.25 KB
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
FROM rust:1.39.0-slim-stretch as cargo-build
ARG DRILL_VERSION=0.7.1
ARG OPENSSL_VERSION=1.0.2u
RUN apt-get update && \
apt-get install -y curl musl-tools make pkg-config && \
rustup target add x86_64-unknown-linux-musl && \
rm -rf /var/lib/apt/lists/*
WORKDIR /src
# Build OpenSSL with musl-gcc: the apt provided ssl does not work with drill & hyper
ENV MUSL=/musl
ENV CC=musl-gcc
ENV LD_LIBRARY_PATH=/musl
RUN cd /src && \
curl -L -O https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz && \
tar xzf openssl-${OPENSSL_VERSION}.tar.gz && \
cd openssl-${OPENSSL_VERSION} && \
./Configure no-zlib no-shared -fPIC --prefix=${MUSL} --openssldir=${MUSL}/ssl linux-x86_64 && \
C_INCLUDE_PATH=${MUSL}/include make depend && \
make && \
make install
ENV OPENSSL_DIR=${MUSL}
RUN cd /src && \
curl -L -O https://github.com/fcsonline/drill/archive/${DRILL_VERSION}.tar.gz && \
tar xzf ${DRILL_VERSION}.tar.gz && \
ln -s drill-${DRILL_VERSION} drill && \
cd drill && \
RUSTFLAGS=-Clinker=musl-gcc cargo build --release --target=x86_64-unknown-linux-musl
FROM alpine:20190707
COPY --from=cargo-build /src/drill/target/x86_64-unknown-linux-musl/release/drill /usr/local/bin/drill
ENTRYPOINT ["/usr/local/bin/drill"]