-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
52 lines (49 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
FROM python:3.7.0-alpine3.8
ARG LIBRDKAFKA_NAME="librdkafka"
ARG LIBRDKAFKA_VER="0.11.6"
# Install librdkafka
RUN apk add --no-cache --virtual .fetch-deps \
ca-certificates \
libressl \
curl \
tar && \
\
BUILD_DIR="$(mktemp -d)" && \
\
curl -sLo "$BUILD_DIR/$LIBRDKAFKA_NAME.tar.gz" "https://github.com/edenhill/librdkafka/archive/v$LIBRDKAFKA_VER.tar.gz" && \
mkdir -p $BUILD_DIR/$LIBRDKAFKA_NAME-$LIBRDKAFKA_VER && \
tar \
--extract \
--file "$BUILD_DIR/$LIBRDKAFKA_NAME.tar.gz" \
--directory "$BUILD_DIR/$LIBRDKAFKA_NAME-$LIBRDKAFKA_VER" \
--strip-components 1 && \
\
apk add --no-cache --virtual .build-deps \
bash \
g++ \
libressl-dev \
make \
musl-dev \
zlib-dev && \
\
cd "$BUILD_DIR/$LIBRDKAFKA_NAME-$LIBRDKAFKA_VER" && \
./configure \
--prefix=/usr && \
make -j "$(getconf _NPROCESSORS_ONLN)" && \
make install && \
\
runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" && \
apk add --no-cache --virtual .librdkafka-rundeps \
$runDeps && \
\
cd / && \
apk del .fetch-deps .build-deps && \
rm -rf $BUILD_DIR
LABEL maintainer="King Chung Huang <[email protected]>" \
org.label-schema.vcs-url="https://github.com/ucalgary/docker-python-librdkafka"