I would like to automatically create a compressed archive from a file given via stdin (or create the archive, if it doesn't exist yet), while specifying the file name that it's going to have inside the archive.
7zip seems to have a feature that does exactly what I'm after (doku).
The usage is like this:
cat some_file.png | 7z a archive.7z -t7z -si"custom_filename1.png"
This adds a file called "custom_filename1.png" to archive.7z. However, I would like to do this without 7zip if possible, because I think 7zip would not be preinstalled on most Linux distributions. I searched for a way to do this with tar, but only found this post which doesn't seem to work on my machine.
I don't want to create temporary files.