yatisht / usher

Ultrafast Sample Placement on Existing Trees
MIT License
120 stars 40 forks source link

Docker image uses an old version of `sed` that doesn't work properly within Docker #370

Open aofarrel opened 4 months ago

aofarrel commented 4 months ago

The dockerfile pulls ubuntu:20.04 as its base image, which includes 4.7 of sed. This version of sed has filesystem issues breaks thing when it is running in a Docker image. If this version of sed is run on a file that is mounted to the Docker image, it does not work, whether or not sed is run with -i or if you chmod 777 the workdir, and even though the container by default runs as root. Note that this does not happen with all versions of Docker -- this is a Docker Desktop thing, but Docker Desktop is what Docker tends to push these days, so compatibility with it is important.

Ideally, a newer base image should be used, or sed should be manually updated to 4.8 somewhere in the Dockerfile.

More information

https://discourse.pi-hole.net/t/sed-couldnt-open-temporary-file-etc-pihole-sed/65159/4

To replicate

This is a known issue with sed and may not need to be replicated, but here's how I found it:

side note (bonus bug?)

There's a rendering error on GitHub with the second sed command. In case it shows up funky, this is what's intended:

Screenshot 2024-03-06 at 12 10 21 PM

Not:

Screenshot 2024-03-06 at 12 10 14 PM

Either way, the point is, this isn't solvable by just not using sed -i.