I get this error tar: Archive is compressed. Use -z option
when trying to build my docker image:
RUN wget https://github.com/wal-g/wal-g/releases/download/v2.0.1/wal-g-pg-ubuntu-20.04-amd64.tar.gz -O - | \
tar -xvf - -O > "${APP}/bin/wal-g"
But why this error happen when -z
option is ignored in extract mode?
-z, --gunzip, --gzip
(c mode only) Compress the resulting archive with gzip(1). In extract or list modes, this
option is ignored. Note that this tar implementation recognizes gzip compression automatically when reading archives.
When I add -z
option, I get another error:
Cannot write to ‘-’ (Success).