Skip to content

Commit 4f95e34

Browse files
authored
Fix librdkafka in final Docker image (#36)
* Bump librdkafka in final image, add test Fixes a bug where prometheus-kafka-adapter wouldn't start because librdkafka wasn't bumped in the final image of the multi-stage build. Also adds a test to Travis that verifies the image can be started. * Add stages to Travis build
1 parent d189755 commit 4f95e34

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.travis.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ language: minimal
66

77
services:
88
- docker
9+
jobs:
10+
include:
11+
- stage: install
12+
script: docker build -t telefonica/prometheus-kafka-adapter .
913

10-
install:
11-
- docker build -t telefonica/prometheus-kafka-adapter .
14+
- stage: test
15+
script:
16+
- docker build -t telefonica/prometheus-kafka-adapter .
17+
- docker run -d --name test telefonica/prometheus-kafka-adapter
18+
- if [ $(docker inspect -f {{.State.Status}} test) = "running" ]; then echo "OK"; exit 0; else echo "FAILED"; exit 1; fi
1219

1320
git:
1421
depth: 1
15-
quiet: true
22+
quiet: true

Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ RUN go build -o /prometheus-kafka-adapter
1111

1212
FROM alpine:3.11
1313

14-
RUN apk add --no-cache librdkafka
14+
RUN echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories && \
15+
echo "@edgecommunity http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
16+
apk add --no-cache 'librdkafka@edgecommunity>=1.3.0'
1517

1618
COPY --from=build /src/prometheus-kafka-adapter/schemas/metric.avsc /schemas/metric.avsc
1719
COPY --from=build /prometheus-kafka-adapter /

0 commit comments

Comments
 (0)