confluentinc / cp-docker-images

[DEPRECATED] Docker images for Confluent Platform.
Apache License 2.0
1.14k stars 705 forks source link

confluentinc/cp-kafka:5.0.1 image make issues #927

Closed Auggie321 closed 1 year ago

Auggie321 commented 1 year ago

folks,

May i ask some question on making confluentinc/cp-kafka:5.0.1 issues ? Want to harden the vulnerability of the container, try not to change the container image version.

I found a lot of problems with missing dependencies when compiling the mvn repository, and some packages do not exist, so I don't know if there is another way to make this image.

Server info:
openjdk 11.0.17 2022-10-18
Maven 3.6.0
Docker version 20.10.12
Ubuntu 18.04.6 LTS

The steps are as follows

git clone -b 5.0.1-post https://github.com/confluentinc/cp-docker-images.git
cd cp-docker-images/
git checkout -b  remotes/origin/5.0.1-post
****
make build-debian failure.

well, found should mvn install some dependencies, check this issues/80

git clone -b v5.0.1  https://github.com/confluentinc/common.git
git branch -a
git checkout -b  remotes/origin/5.0.1-post
mvn install

after this, change to cp-docker-images, make build-debian, still found some dependencies issues, check http://packages.confluent.io/maven/ ,no way to find the corresponding package.

make build error info:

root@vultr ~/cp-docker-images (5.0.1-post) $ make build-debian
mkdir -p debian/base/include/etc/confluent/docker
mvn clean compile package assembly:single -DskipTests \
&& cp target/docker-utils-5.0.5-jar-with-dependencies.jar debian/base/include/etc/confluent/docker/docker-utils.jar \

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: linux
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 4.15
[INFO] os.detected.version.major: 4
[INFO] os.detected.version.minor: 15
[INFO] os.detected.release: ubuntu
[INFO] os.detected.release.version: 18.04
[INFO] os.detected.release.like.ubuntu: true
[INFO] os.detected.release.like.debian: true
[INFO] os.detected.classifier: linux-x86_64
[INFO] 
[INFO] ---------------------< io.confluent:docker-utils >----------------------
[INFO] Building docker-utils 5.0.5-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.apache.kafka:kafka_2.11:jar:2.0.2-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.apache.kafka:kafka-clients:jar:2.0.2-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.146 s
[INFO] Finished at: 2023-02-14T01:48:26Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project docker-utils: Could not resolve dependencies for project io.confluent:docker-utils:jar:5.0.5-SNAPSHOT: The following artifacts could not be resolved: org.apache.kafka:kafka_2.11:jar:2.0.2-SNAPSHOT, org.apache.kafka:kafka-clients:jar:2.0.2-SNAPSHOT: Failure to find org.apache.kafka:kafka_2.11:jar:2.0.2-SNAPSHOT in http://packages.confluent.io/maven/ was cached in the local repository, resolution will not be reattempted until the update interval of confluent has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Makefile:50: recipe for target 'debian/base/include/etc/confluent/docker/docker-utils.jar' failed
make: *** [debian/base/include/etc/confluent/docker/docker-utils.jar] Error 1
root@vultr ~/cp-docker-images (5.0.1-post) $ 
Auggie321 commented 1 year ago

well, found the other solution.

step1: cp-docker-images/debian/base, build new cp-base;

step2: cp-docker-images/debian/kafka, from new cp-base, build cp-kafka images.

there will need to change debian repo and configurations in dockerfile.