apicurio-registry-examples
apicurio-registry-examples copied to clipboard
Fix tools/kafka-all/Dockerfile to work
I tried to set up ZK and Kafka following the comments in tools/kafka-all/Dockerfile before running examples, but I came across the following error:
$ cd tools/kafka-all
$ docker build -t="apicurio/kafka-all" --rm .
...
1.019 Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
------
Dockerfile:6
--------------------
5 |
6 | >>> RUN yum update -y && \
7 | >>> yum install -y java-1.8.0-openjdk-devel && \
8 | >>> curl http://mirror.cc.columbia.edu/pub/software/apache/kafka/2.5.0/kafka_2.12-2.5.0.tgz -o /tmp/kafka.tgz && \
9 | >>> tar xfz /tmp/kafka.tgz -C /usr/local && \
10 | >>> mv /usr/local/kafka_2.12-2.5.0 /usr/local/kafka
11 |
--------------------
ERROR: failed to solve: process "/bin/sh -c yum update -y && yum install -y java-1.8.0-openjdk-devel && curl http://mirror.cc.columbia.edu/pub/software/apache/kafka/2.5.0/kafka_2.12-2.5.0.tgz -o /tmp/kafka.tgz && tar xfz /tmp/kafka.tgz -C /usr/local && mv /usr/local/kafka_2.12-2.5.0 /usr/local/kafka" did not complete successfully: exit code: 1
This is because the centos:8
image has already been deprecated, so we should use other images such as centos:stream8
instead. In addition, there seem to be other issues in that file, e.g.,
- Kafka download URL doesn't seem to work.
- Kafka's version is obsolete a bit. It should be consolidated with the one defined in pom.xml.
- Apicurio Registry's version is also obsolete. It should be consolidated with the value in run-registry.sh.
- In my environment, the
--net host
option for thedocker
commands was required to run the simple-avro example successfully.