I just make multarch images by using buildx
When running docker buildx build --platform linux/amd64,linux/arm64 -t maskertim/zookeeper-demo .
Error Message
The Error as following:
------
> [linux/arm64 3/5] RUN curl "https://archive.apache.org/dist/kafka/2.8.0/kafka_2.13-2.8.0.tgz" -o /tmp/kafka/kafka.tgz && mkdir /kafka && cd /kafka && tar -xzvf /tmp/kafka/kafka.tgz --strip 1:
#8 0.915 % Total % Received % Xferd Average Speed Time Time Time Current
#8 0.916 Dload Upload Total Spent Left Speed
100 68.0M 100 68.0M 0 0 936k 0 0:01:14 0:01:14 --:--:-- 3475k
#8 75.45 tar: Child returned status 1
#8 75.45 tar: Error is not recoverable: exiting now
------
dockerfile:9
--------------------
8 |
9 | >>> RUN curl "https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" \
10 | >>> -o /tmp/kafka/kafka.tgz && \
11 | >>> mkdir /kafka && cd /kafka && \
12 | >>> tar -xzvf /tmp/kafka/kafka.tgz --strip 1
13 |
--------------------
error: failed to solve: process "/dev/.buildkit_qemu_emulator /bin/sh -c curl \"https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz\" \t-o /tmp/kafka/kafka.tgz && \tmkdir /kafka && cd /kafka && \ttar -xzvf /tmp/kafka/kafka.tgz --strip 1" did not complete successfully: exit code: 2
Dockerfile
And this is my dockerfile:
FROM openjdk:11.0.12-jre-buster
ENV KAFKA_VERSION 2.8.0
ENV SCALA_VERSION 2.13
RUN mkdir /tmp/kafka && \
apt-get update && \
apt-get install -y curl
RUN curl "https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" \
-o /tmp/kafka/kafka.tgz && \
mkdir /kafka && cd /kafka && \
tar -xzvf /tmp/kafka/kafka.tgz --strip 1
COPY start-zookeeper.sh /usr/bin
RUN chmod +x /usr/bin/start-zookeeper.sh
CMD ["start-zookeeper.sh"]
What happens? I have no idea why to occur this error and no way to solve it.