skeeto / w64devkit

Portable C and C++ Development Kit for x64 (and x86) Windows
The Unlicense
2.68k stars 185 forks source link

zip error: Invalid command arguments (cannot write zip file to terminal) #53

Closed randvmbone closed 1 year ago

randvmbone commented 1 year ago

Dockerfile:481 CMD zip -qXr - $PREFIX

When you use "-" as the destination file for the zip command, it tells zip to write the output to the standard output (i.e. the terminal)

suggested:

CMD zip -qXr w64devkit.zip $PREFIX

skeeto commented 1 year ago

That's intentional. It's the mechanism that transfers the .zip out of the container, so attaching the container output to a terminal is mistake. As documented in README.md:

$ docker build -t w64devkit .
$ docker run --rm w64devkit >w64devkit.zip

Besides redirecting output, don't use the --tty (-t) option either. The alternative would be to "docker cp" the .zip out of a concurrently running container, which is far more complicated, impossible to script robustly, and error prone.

randvmbone commented 1 year ago

ah sorry, makes sense now