Skip to content

Commit

Permalink
feat(librdkafka): Create image alpine-based (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukkor authored Apr 3, 2019
1 parent 9c0e062 commit de9ceb2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
12 changes: 12 additions & 0 deletions librdkafka/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions librdkafka/README.md
Original file line number Diff line number Diff line change
@@ -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
```

0 comments on commit de9ceb2

Please sign in to comment.