Error using flags when building copying using Docker
I recently did a PR on oxsecurity/megalinter where I tried to include stylua in the linters for LUA. When using the Docker approach I ran into some issues, that using the cargo approach didn't trigger.
- The codebase of
MegaLinteruses test to get the help command:
- When trying to get the
stylua -horstylua --helpit wouldn't show. - reference to action failling
- The codebase of
MegaLinteruses test to get the version command:
- When trying to get the
stylua -Vorstylua --versionit wouldn't show. - reference to action failling
- The codebase of
MegaLinteruses tests to check for successful or failure on.luafiles:
- When trying to use
stylua --check lua_good_1.luaorstylua --check lua_bad_1.luait wouldn't findstyluacommand. - reference to action failling
The codebase it's built using the Docker image python:3.12.6-alpine3.20.
The part where we use alpine is important. It doesn't use glibc (by default) (it uses musl), and it is often expected to use static linking to have binaries that can just be copied and just run.
I suspect that it could probably be copied from the docker image to any glibc-based image (almost any other distribution
In reference to this comment from one of the maintainers https://github.com/oxsecurity/megalinter/pull/3985#issuecomment-2346080384
Reference to show how I was copying using Docker here.
Reference to show how it's implemented using cargo here
[!note] I am curious why there is this difference from using
cargo installto Docker'sCOPY --from.