2

When executing

docker run --rm -v ldaps_ldap-config:/volume -v /tmp/tmp.VznAcI3PTA:/backup busybox tar c -Jvf /backup/ldap-config.tar /volume

I always get the following output:

BusyBox v1.31.0 (2019-07-16 01:13:11 UTC) multi-call binary.

Usage: xz -d [-cfk] [FILE]...

Decompress FILE (or stdin)

    -d  Decompress
    -c  Write to stdout
    -f  Force
    -k  Keep input files
tar: write error: Broken pipe

I use the following versions:

Docker version 18.06.3-ce, build d7080c1
BusyBox v1.31.0 (2019-07-16 01:13:11 UTC) multi-call binary.

Is this because of busybox or am I doing something wrong?

How can I fix this?

1 Answer 1

2

The Busybox container only has the Busybox version of xz, which can only decompress.

The simplest option here is to use another compressor; the safest best is -z instead of -J (gzip).

5
  • Do you know why this was decided?
    – Alexander
    Commented Aug 26, 2019 at 13:05
  • I don’t know whether it was decided explicitly. I suspect it’s a combination of factors: Busybox’s target use cases mean that decompression is sufficient, so expensive compression is a lower priority (which includes xz), and the point of the Busybox container image is to contain only Busybox and anything it absolutely needs (which doesn’t include xz, apparently, although again I suspect there wasn’t an explicit decision about this). Commented Aug 26, 2019 at 13:16
  • I know that you have better things to do with your time, but if you could give a hint I would really appreciated. I am using kubernetes with initContainers, and image image: busybox:1.28, and I am trying to decompress a file "tar -xvf file.tar", but the file never gets decompressed any suggestion?
    – dreamcrash
    Commented Apr 7, 2021 at 18:57
  • @dreamcrash please ask a new question, that way you’ll be able to provide more detail and more people will see your question and hopefully be able to answer it. Commented Apr 7, 2021 at 19:10
  • @StephenKitt I will do that thanks
    – dreamcrash
    Commented Apr 7, 2021 at 19:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .