forked from strimzi/strimzi-kafka-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use one common base image (strimzi#1991)
* Use one common base image Signed-off-by: Jakub Scholz <[email protected]> * Run the targets properly Signed-off-by: Jakub Scholz <[email protected]> * Fix incorrect JAVA_HOME path Signed-off-by: Jakub Scholz <[email protected]> * We do not need the JAVA_HOME Signed-off-by: Jakub Scholz <[email protected]>
- Loading branch information
Showing
8 changed files
with
63 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM centos:7 | ||
ARG JAVA_VERSION=1.8.0 | ||
|
||
RUN yum -y update \ | ||
&& yum -y install java-${JAVA_VERSION}-openjdk-headless openssl \ | ||
&& yum -y clean all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
PROJECT_NAME=base | ||
|
||
include ../../Makefile.os | ||
include ../../Makefile.docker | ||
|
||
docker_push: | ||
# Do nothing | ||
|
||
.PHONY: build clean release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,75 @@ | ||
FROM centos:7 | ||
FROM strimzi/base:latest | ||
|
||
ARG JAVA_VERSION | ||
ARG KAFKA_SHA512 | ||
ARG KAFKA_VERSION | ||
ARG THIRD_PARTY_LIBS | ||
ARG strimzi_version | ||
|
||
RUN yum -y update \ | ||
&& yum -y install java-${JAVA_VERSION}-openjdk-headless gettext nmap-ncat openssl \ | ||
&& yum clean all -y | ||
|
||
# set Kafka home folder | ||
ENV KAFKA_HOME=/opt/kafka | ||
|
||
ENV KAFKA_EXPORTER_HOME=/opt/kafka-exporter | ||
RUN yum -y install gettext nmap-ncat stunnel net-tools bind-utils && yum clean all -y | ||
|
||
# Add kafka user with UID 1001 | ||
# The user is in the group 0 to have access to the mounted volumes and storage | ||
RUN useradd -r -m -u 1001 -g 0 kafka | ||
|
||
# Set Scala and Kafka version | ||
##### | ||
# Add Kafka | ||
##### | ||
ENV KAFKA_HOME=/opt/kafka | ||
ENV KAFKA_VERSION=${KAFKA_VERSION} | ||
ENV STRIMZI_VERSION=${strimzi_version} | ||
ENV SCALA_VERSION=2.12 | ||
|
||
ENV KAFKA_EXPORTER_VERSION=1.2.0 | ||
ENV KAFKA_EXPORTER_CHECKSUM="7afa40365ddf0cb0a88457684bd64d565e250c7e5a4536ba7f9d37d02d2808c3b07766f94e0b1338beb296573ade29db630948c931be44bde416c0410b5d783b kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-amd64.tar.gz" | ||
|
||
# Set Kafka (SHA512) and Prometheus JMX exporter (SHA1) checksums | ||
ENV KAFKA_CHECKSUM="${KAFKA_SHA512} kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" | ||
|
||
# Downloading/extracting Apache Kafka | ||
RUN curl -O https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz \ | ||
&& echo $KAFKA_CHECKSUM > kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz.sha512 \ | ||
&& sha512sum --check kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz.sha512 \ | ||
&& mkdir $KAFKA_HOME \ | ||
&& tar xvfz kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz -C $KAFKA_HOME --strip-components=1 \ | ||
&& rm -f kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz* | ||
|
||
# Downloading/extracting Kafka Exporter | ||
COPY ./scripts/ $KAFKA_HOME | ||
|
||
##### | ||
# Add Kafka Exporter | ||
##### | ||
ENV KAFKA_EXPORTER_HOME=/opt/kafka-exporter | ||
ENV KAFKA_EXPORTER_VERSION=1.2.0 | ||
ENV KAFKA_EXPORTER_CHECKSUM="7afa40365ddf0cb0a88457684bd64d565e250c7e5a4536ba7f9d37d02d2808c3b07766f94e0b1338beb296573ade29db630948c931be44bde416c0410b5d783b kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-amd64.tar.gz" | ||
|
||
RUN curl -LO https://github.com/danielqsj/kafka_exporter/releases/download/v${KAFKA_EXPORTER_VERSION}/kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-amd64.tar.gz \ | ||
&& echo $KAFKA_EXPORTER_CHECKSUM > kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-amd64.tar.gz.sha512 \ | ||
&& sha512sum --check kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-amd64.tar.gz.sha512 \ | ||
&& mkdir $KAFKA_EXPORTER_HOME \ | ||
&& tar xvfz kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-amd64.tar.gz -C $KAFKA_EXPORTER_HOME --strip-components=1 \ | ||
&& rm -f kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-amd64.tar.gz* | ||
|
||
COPY ./exporter-scripts $KAFKA_EXPORTER_HOME | ||
|
||
##### | ||
# Add Strimzi agents | ||
##### | ||
COPY ./tmp/kafka-agent.jar ${KAFKA_HOME}/libs/ | ||
COPY ./tmp/mirror-maker-agent.jar ${KAFKA_HOME}/libs/ | ||
COPY ./tmp/tracing-agent.jar ${KAFKA_HOME}/libs/ | ||
|
||
##### | ||
# Add 3dr party libs | ||
##### | ||
COPY kafka-thirdparty-libs/${THIRD_PARTY_LIBS}/target/dependency/ ${KAFKA_HOME}/libs/ | ||
|
||
RUN yum -y install stunnel net-tools bind-utils && yum clean all -y | ||
|
||
# set Stunnel home folder | ||
##### | ||
# Add Stunnel | ||
##### | ||
ENV STUNNEL_HOME=/opt/stunnel | ||
|
||
RUN mkdir $STUNNEL_HOME && mkdir -p -m g+rw /usr/local/var/run/ | ||
|
||
# copy scripts for Stunnel | ||
COPY ./stunnel-scripts/ $STUNNEL_HOME | ||
|
||
# copy scripts for starting Kafka | ||
COPY ./scripts/ $KAFKA_HOME | ||
|
||
# Set S2I folder | ||
##### | ||
# Add Kafka Connect S2I feature | ||
##### | ||
ENV S2I_HOME=/opt/kafka/s2i | ||
|
||
# Copy S2I scripts | ||
COPY ./s2i-scripts $S2I_HOME | ||
|
||
# Copy Kafka Exporter scripts | ||
COPY ./exporter-scripts $KAFKA_EXPORTER_HOME | ||
|
||
WORKDIR $KAFKA_HOME | ||
|
||
USER 1001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters