Closed hukl closed 2 years ago
The reason was that COPY
also copied the local _build
folder which contained the esbuild executable which was of the type esbuild: Mach-O 64-bit executable arm64
and therefor didn't run in our linux docker image. Would've still been great to have a more descriptive error ;)
It's difficult to get a descriptive error for this case. If the wrong esbuild binary thought for a different OS architecture is present, the call to esbuild will possibly just fail (or even work and then fail).
But I understand if one stumble across this problem it's difficult to find the cause.
The current esbuild implementation does not have any information for which OS architecture the present esbuild binary is for.
The only solution I could think of, we would need to save the esbuild binary with the OS architecture information attached.
→ _build/esbuild-linux-64
Then at runtime always check the target and call the binary with it.
@josevalim May I ask you for your opinion? Is it worth it to go this way?
@cw789 I think saving it as esbuild-linux64 doesn't hurt and we already have the logic to compute the architecture anyway. Can you please send a PR? :)
Oh I'm glad filing this was still useful :)
Can you please send a PR? :)
Sure, I love to do so.
Oh I'm glad filing this was still useful :)
Of course it is. Thanks. Give me some time and we both won't stumble again over this problem.
Versions: nodejs: 16.13 phoenix: 1.6.0 elixir: 1.12.3 esbuild: 0.3.4 docker: 20.10.6
We're using the elixir:1.12.3-alpine docker image to assemble our release. Up until recently this worked fine but now we're getting the following mysterious error code when running
On our dev machines, this works fine with the same phoenix, elixir, esbuild and nodejs versions and we haven't changed the contents of the docker image. The only possible difference that is left after our long debugging session is that the docker image which works, was built and cached by an earlier docker version. But without knowing what
exited with 8
means, we're stuck at this point.Our docker file looks as follows:
Any clues would be appreciated!