diff --git a/librdkafka/Dockerfile b/librdkafka/Dockerfile new file mode 100644 index 0000000..122a873 --- /dev/null +++ b/librdkafka/Dockerfile @@ -0,0 +1,12 @@ +FROM alpine:3.9 + +ENV LIBRESSL_VERSION=2.7 +ENV LIBRDKAFKA_VERSION=1.0.0 + +RUN apk add --no-cache bash curl git openssh openssl yajl-dev zlib-dev cyrus-sasl-dev openssl-dev build-base coreutils && \ + apk add libressl${LIBRESSL_VERSION}-libcrypto libressl${LIBRESSL_VERSION}-libssl --update-cache --repository http://nl.alpinelinux.org/alpine/edge/main + +RUN curl -Lk -o /root/librdkafka-${LIBRDKAFKA_VERSION}.tar.gz https://github.com/edenhill/librdkafka/archive/v${LIBRDKAFKA_VERSION}.tar.gz && \ + tar -xzf /root/librdkafka-${LIBRDKAFKA_VERSION}.tar.gz -C /root && \ + cd /root/librdkafka-${LIBRDKAFKA_VERSION} && \ + ./configure --prefix /usr && make && make install && make clean && ./configure --clean diff --git a/librdkafka/README.md b/librdkafka/README.md new file mode 100644 index 0000000..09b9b89 --- /dev/null +++ b/librdkafka/README.md @@ -0,0 +1,23 @@ +# librdkafka in alpine + +We use this image in multistage build to copy `librdkafka` to our final images. + +# Tags + +The tag is composed of the flavor of linux we used to build and the version of `librdkafka` e.g. `jobteaser/librdkafka:alpine-v1.0.0`. + +# Example + +``` +FROM jobteaser/librdkafka:alpine-v1.0.0 as librdkafka +FROM golang:1.12 + +# ... + +COPY --from=librdkafka /usr/include /usr/include +COPY --from=librdkafka /usr/lib /usr/lib + +# ... + +RUN make build +```