Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am getting a returned a non-zero code: 8 when building my docker file

I am setting up Kafka and zookeeper through docker; however, my whenever I build my image I keep getting a code 8 error when it gets to:

wget -q  https://www.apache.org/dist/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz.asc .

I have tried to change the file format in the download-kafka.sh to unix already.

Below is my dockerfile:

FROM Wurstmeister/base

MAINTAINER Wurstmeister

ENV ZOOKEEPER_VERSION 3.4.13

#Download Zookeeper
RUN wget -q http://mirror.vorboss.net/apache/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz && \
    wget -q https://www.apache.org/dist/zookeeper/KEYS && \
    wget -q https://www.apache.org/dist/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz.asc && \
    wget -q https://www.apache.org/dist/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz.md5

#Verify download
RUN md5sum -c zookeeper-${ZOOKEEPER_VERSION}.tar.gz.md5 && \
gpg --import KEYS && \
gpg --verify zookeeper-${ZOOKEEPER_VERSION}.tar.gz.asc

#Install
RUN tar -xzf zookeeper-${ZOOKEEPER_VERSION}.tar.gz -C /opt

#Configure
RUN mv /opt/zookeeper-${ZOOKEEPER_VERSION}/conf/zoo_sample.cfg /opt/zookeeper-${ZOOKEEPER_VERSION}/conf/zoo.cfg

ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64
ENV ZK_HOME /opt/zookeeper-${ZOOKEEPER_VERSION}
RUN sed  -i "s|/tmp/zookeeper|$ZK_HOME/data|g" $ZK_HOME/conf/zoo.cfg; mkdir $ZK_HOME/data

ADD start-zk.sh /usr/bin/start-zk.sh 
EXPOSE 2181 2888 3888

WORKDIR /opt/zookeeper-${ZOOKEEPER_VERSION}
VOLUME ["/opt/zookeeper-${ZOOKEEPER_VERSION}/conf", "/opt/zookeeper-${ZOOKEEPER_VERSION}/data"]

CMD /usr/sbin/sshd && bash /usr/bin/start-zk.sh

like image 267
James Ukilin Avatar asked Jul 08 '19 18:07

James Ukilin


People also ask

What is Docker exit code1?

Exit Code 1 Indicates that the container stopped due to either an application error or an incorrect reference in Dockerfile to a file that is not present in the container.

What is Docker compose up command?

'docker-compose up' is a Docker command to start and run an entire app on a standalone host that contains multiple services, for example, Web, DB, etc. It can also create volumes and networks at the same time and attach to the containers that are defined in a file called 'docker-compose.

Does Docker cache the first step of the process?

With the typo corrected, the process moved a little faster, since Docker cached the first step rather than redownloading the base image. But as you can see from the output, we have a new error.

What happens when you start a docker container?

When the container starts, you’ll see a root prompt waiting for instructions: Now that you have a running container, let’s look at what kinds of problems you might run into. When you run a container the way you just did, without explicitly setting a name, Docker assigns a random name to the container.

What does it mean when a dockerfile says “steps complete”?

This generally means that if you got to a certain step, then all of the previous steps completed successfully. Let’s create a little project to explore some issues you might encounter with a Dockerfile.

How to install Docker on a local machine?

You can visit the Docker web site or follow the official installation documentation to install Docker on your local machine. The most common place you may run into issues is when you’re building your Docker image from a Dockerfile. Before we dive in, let’s clarify the difference between images and containers.


1 Answers

If you go to this link, then 3.4.13 doesn't exist anymore

https://www.apache.org/dist/zookeeper/

You can change to ENV ZOOKEEPER_VERSION 3.4.14, or just use an existing Zookeeper Docker image

like image 113
OneCricketeer Avatar answered Oct 19 '22 06:10

OneCricketeer