anaconda/docker-images

Broken symlinks in miniconda3 image

jonathan-conder-sm opened this issue · 0 comments

I would've expected this command to give empty output:

$ docker run --rm -it continuumio/miniconda3 find /opt/conda/ -name '*.a'
/opt/conda/lib/libncurses++.a
/opt/conda/lib/libtinfo.a
/opt/conda/lib/libform.a

The problem is that these are symlinks and this command deletes the targets before processing the links themselves. Could be fixed using something like this:

static_libs="$(mktemp '/tmp/static-libs.XXXXXXXX')"
find /opt/conda -follow -type f -name '*.a' -print0 > "${static_libs}"
xargs -0 rm -f < "${static_libs}"
rm -f "${static_libs}"

But I think it would be nicer to implement this in conda itself and have an option it, like how the debian/ubuntu images have /etc/apt/apt.conf.d/docker-clean.