summaryrefslogtreecommitdiffstats
path: root/src/main/docker/Dockerfile
blob: 1896aabb159e52b643c0516ebda4e37c5d582109 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM confluentinc/cp-base:5.3.1

# allow arg override of required env params
ARG KAFKA_ZOOKEEPER_CONNECT
ENV KAFKA_ZOOKEEPER_CONNECT=${KAFKA_ZOOKEEPER_CONNECT}
ARG KAFKA_ADVERTISED_LISTENERS
ENV KAFKA_ADVERTISED_LISTENERS=${KAFKA_ADVERTISED_LISTENERS}

ENV COMPONENT=kafka \
    KAFKA_USER=mrkafka

RUN echo "===> installing ${COMPONENT}..." \
    && apt-get update && apt-get install -y confluent-kafka-${SCALA_VERSION}=${CONFLUENT_VERSION}${CONFLUENT_PLATFORM_LABEL}-${CONFLUENT_DEB_VERSION} \
    \
    && echo "===> clean up ..."  \
    && apt-get clean && rm -rf /tmp/* /var/lib/apt/lists/* \
    \
    && echo "===> Setting up ${COMPONENT} dirs..." \
    && mkdir -p /var/lib/${COMPONENT}/data /etc/${COMPONENT}/secrets/cert /etc/${COMPONENT}/secrets/jaas /etc/${COMPONENT}/data  /var/log/kafka /var/log/confluent \
    && chmod -R ag+w /etc/${COMPONENT} /var/lib/${COMPONENT}/data   /etc/${COMPONENT}/secrets /etc/${COMPONENT}/data  /var/log/kafka /var/log/confluent \
    && chown -R root:root /var/log/kafka /var/log/confluent /var/lib/kafka /var/lib/zookeeper 

COPY include/etc/confluent/docker /etc/confluent/docker
RUN chmod -R +x /etc/confluent/docker

COPY org.onap.dmaap.mr.trust.jks \
     org.onap.dmaap.mr.p12 \
     org.onap.dmaap.mr.keyfile \
     /etc/${COMPONENT}/secrets/cert/

COPY  kafka11aaf-jar-with-dependencies.jar /usr/share/java/${COMPONENT}/


RUN useradd  -u 1000  -g 0 $KAFKA_USER

USER $KAFKA_USER

EXPOSE 9092 9093

CMD ["/etc/confluent/docker/run"]