Docker Community Forums

Share and learn in the Docker community.

Dockerfile while building is returning non-zero code: 8 error

my dockerfile content is

FROM centos:7
MAINTAINER rishav.jaiswal.2019@gmail.com

ENV KAFKA_BIN http://www-eu.apache.org/dist/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz

RUN yum install -y wget java-1.8.0-openjdk
RUN cd /tmp && wget -q KAFKA_BIN \ && export K_TAR=/tmp/(ls kafka* | head -1)
&& mkdir -p /opt/apache/kafka
&& tar -zxf K_TAR -C /opt/apache/kafka/ \ && cd /opt/apache/kafka && ln -s (ls) current
&& rm -rf $K_TAR

ENV KAFKA_HOME /opt/apache/kafka/current
ENV PATH $PATH:$KAFKA_HOME/bin

ADD resources /home/kafka

RUN groupadd -r kafka
&& useradd -r -g kafka kafka
&& mkdir -p /home/kafka
&& chown -R kafka:kafka /home/kafka
&& chmod -R +x /home/kafka/scripts
&& mkdir -p /var/log/kafka
&& chown -R kafka:kafka /var/log/kafka
&& mkdir -p /etc/kafka
&& chown -R kafka:kafka /etc/kafka

USER kafka

CMD /home/lucky/Desktop/script/run.sh

and output i am getting is
.
.
.
Complete!
Removing intermediate container ea0fd659dad7
—> 43158bc1be83
Step 5/11 : RUN cd /tmp && wget -q KAFKA_BIN && export K_TAR=/tmp/(ls kafka* | head -1) && mkdir -p /opt/apache/kafka && tar -zxf K_TAR -C /opt/apache/kafka/ && cd /opt/apache/kafka && ln -s (ls) current && rm -rf $K_TAR
—> Running in 27108a34fbdc
The command ‘/bin/sh -c cd /tmp && wget -q KAFKA_BIN && export K_TAR=/tmp/(ls kafka* | head -1) && mkdir -p /opt/apache/kafka && tar -zxf K_TAR -C /opt/apache/kafka/ && cd /opt/apache/kafka && ln -s (ls) current && rm -rf $K_TAR’ returned a non-zero code: 8

should there be a $ in front of K_TAR?