1. 獲取源碼:
git clone https://github.com/confluentinc/cp-docker-images.git
#進入目錄
cd cp-docker-images
make build-debian
默認情況下,會報如下錯誤:
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'version' contains an expression but should be a constant. @ line 26, column 14
[FATAL] Non-resolvable parent POM for io.confluent:docker-utils:${confluent.version}: Could not find artifact io.confluent:common:pom:5.3.1 in central (https://repo.maven.apache.org/maven2) and 'parent.relativePath' points at
修改pom.xml加入如下內容即可:
<repositories>
<repository>
<id>confluent</id>
<url>https://packages.confluent.io/maven/</url>
</repository>
</repositories>
3. 修改bin/build-debian文件,找到docker build,在其後加入參數--add-host d1i4a15mxbxib1.cloudfront.net:52.84.225.183,否則,會在打包的過程中報錯:
Step 34/35 : RUN confluent-hub install --no-prompt confluentinc/kafka-connect-datagen:latest
---> Running in 12312131213
Running in a "--no-prompt" mode
Implicit acceptance of the license below:
Apache License 2.0
https://www.apache.org/licenses/LICENSE-2.0
Downloading component Kafka Connect Datagen 0.1.1, provided by Confluent, Inc. from Confluent Hub and installing into /usr/share/confluent-hub-components
java.net.UnknownHostException: d1i4a15mxbxib1.cloudfront.net
4. 如果下載zulu時報錯,可以將zulu換成openjdk,在debian系統上的安裝命令爲apt-get install openjdk-8-jdk,在centos上的安裝命令爲yum install -y java-1.8.0-openjdk