Closed ndd1970 closed 4 years ago
I suspect the version of tar
that you're using is unable to handle the compression format used by https://www.archlinux.org/packages/core/x86_64/gcc-libs/download.
To be clear, the error you're facing has nothing to do with the glibc
Alpine Linux packages. It's caused by attempting to decompress a /tmp/gcc-libs.tar.xz
file using tar
with incorrect flags for that kind of compressed archive.
Using file
to determine the file type should give you some clues as to how this can be resolved:
$ file /tmp/gcc-libs.tar.xz
/tmp/gcc-libs.tar.xz: Zstandard compressed data (v0.8+), Dictionary ID: None
Making the following changes to your Dockerfile
should fix this issue for you:
diff --git a/Dockerfile b/Dockerfile
index 00dd40d..0e5359a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,7 +2,7 @@ FROM alpine:3.9
RUN apk upgrade -U \
&& echo "DEBUG *************** Past 1" \
- && apk --update add --no-cache ca-certificates curl openssl binutils wget xz \
+ && apk --update add --no-cache ca-certificates curl openssl binutils wget zstd \
&& echo "DEBUG *************** Past 2" \
&& GLIBC_VER="2.29-r0" \
&& echo "DEBUG *************** Past 3" \
@@ -24,15 +24,16 @@ RUN apk upgrade -U \
&& echo "DEBUG *************** Past 11" \
&& apk add /tmp/i18n-${GLIBC_VER}.apk \
&& echo "DEBUG *************** Past 12" \
- && curl -Ls https://www.archlinux.org/packages/core/x86_64/gcc-libs/download > /tmp/gcc-libs.tar.xz \
+ && curl -Ls https://www.archlinux.org/packages/core/x86_64/gcc-libs/download > /tmp/gcc-libs.tar.zst \
&& echo "DEBUG *************** Past 13" \
&& mkdir /tmp/gcc \
&& echo "DEBUG *************** Past 14" \
&& ls /tmp -AlR \
&& echo "DEBUG *************** Past 14A - END OF DIRECTORY /tmp" \
- && tar -t /tmp/gcc-libs.tar.xz \
+ && zstd -d /tmp/gcc-libs.tar.zst \
+ && tar -tf /tmp/gcc-libs.tar \
&& echo "DEBUG *************** Past 14B - END OF TAR DUMP " \
- && tar -xf /tmp/gcc-libs.tar.xz -C /tmp/gcc \
+ && tar -xf /tmp/gcc-libs.tar -C /tmp/gcc \
&& echo "DEBUG *************** Past 15" \
&& mv /tmp/gcc/usr/lib/libgcc* /tmp/gcc/usr/lib/libstdc++* /usr/glibc-compat/lib \
&& echo "DEBUG *************** Past 16" \
We are running the following script to create a docker image....but we get a "tar: invalid tar magic" as part of our output. Please see the full script and the output below. We have tried to use version of the gcc 2.29-r0 to 2.31-r0 but this made no difference, and we also went from Alpine 3.9 to Alpine 3.12.
however, we get the following error in our output