forked from confluentinc/confluent-kafka-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (47 loc) · 1.29 KB
/
Copy pathDockerfile
File metadata and controls
55 lines (47 loc) · 1.29 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
###############################################################################
# BUILD STAGE
FROM golang:alpine
ADD ./kafkacat.go /go
RUN apk --no-cache update && apk --no-cache add \
build-base \
gcc \
&& apk --no-cache add \
git \
pkgconf \
bash \
&& mkdir librdkafka \
&& git clone https://github.com/edenhill/librdkafka.git librdkafka \
&& cd librdkafka \
&& ./configure \
&& make \
&& make install \
&& cd .. \
&& rm -rf librdkafka \
&& cd /go \
&& go get github.com/confluentinc/confluent-kafka-go/kafka \
&& go get gopkg.in/alecthomas/kingpin.v2 \
&& go build ./kafkacat.go
###############################################################################
# PACKAGE STAGE
FROM alpine
RUN apk --no-cache update && apk --no-cache add --virtual build-dependencies \
build-base \
gcc \
&& apk --no-cache add \
git \
pkgconf \
bash \
&& mkdir librdkafka \
&& git clone https://github.com/edenhill/librdkafka.git librdkafka \
&& cd librdkafka \
&& ./configure \
&& make \
&& make install \
&& cd .. \
&& rm -rf librdkafka \
&& apk del \
build-dependencies \
git \
bash
ENTRYPOINT ["./kafkacat"]
COPY --from=0 /go/kafkacat /kafkacat