-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(librdkafka): Create image alpine-based (#69)
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |