mhart / alpine-node

Minimal Node.js Docker Images built on Alpine Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting transient errors when trying to build with latest node 10 version

ajkamel opened this issue · comments

@mhart with the latest commits today to alpine node 10.16.0 we are getting the following errors when building.

 ---> Running in 32a5d852b13b
 ---> 691f0110d32b
Removing intermediate container 32a5d852b13b
Step 11/12 : RUN npm run build
 ---> Running in dcbc64d170ab
Error loading shared library libstdc++.so.6: No such file or directory (needed by /usr/bin/node)
Error loading shared library libgcc_s.so.1: No such file or directory (needed by /usr/bin/node)
Error relocating /usr/bin/node: _ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1ESt13_Ios_Openmode: symbol not found
Error relocating /usr/bin/node: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc: symbol not found
Error relocating /usr/bin/node: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6resizeEmc: symbol not found
Error relocating /usr/bin/node: _ZSt18_Rb_tree_incrementPKSt18_Rb_tree_node_base: symbol not found

Hmmm, what does docker run --rm mhart/alpine-node:10.16.0 ldd /usr/bin/node show for you?

For me:

$ docker run --rm mhart/alpine-node:10.16.0 ldd /usr/bin/node
	/lib/ld-musl-x86_64.so.1 (0x7f401e664000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7f401bf0d000)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f401bcfb000)
	libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f401e664000)
$ docker run --rm mhart/alpine-node:10.16.0 ls -l /usr/lib/libstdc++.so.6
-rwxr-xr-x    1 root     root       1370496 Oct 31  2017 /usr/lib/libstdc++.so.6

@mhart Getting the same today running 8.16.0.

When I run the requested commands above I get the following:

$ docker run --rm mhart/alpine-node:8.16.0 ldd /usr/bin/node`
	/lib/ld-musl-x86_64.so.1 (0x7fcb0b4c3000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7fcb09231000)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7fcb0901f000)
	libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7fcb0b4c3000)
$ docker run --rm mhart/alpine-node:8.16.0 ls -l /usr/lib/libstdc++.so.6
-rwxr-xr-x    1 root     root       1370496 May  2  2017 /usr/lib/libstdc++.so.6

We hadn't seen this issue prior to today and I just used this same container last night as mhart/alpine-node:8.

Here is a snippet of the errors we are getting when running this container:

Error loading shared library libstdc++.so.6: No such file or directory (needed by /usr/bin/node)
Error loading shared library libgcc_s.so.1: No such file or directory (needed by /usr/bin/node)
Error relocating /usr/bin/node: _ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1ESt13_Ios_Openmode: symbol not found
Error relocating /usr/bin/node: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6resizeEmc: symbol not found
...

Ugh, that's so weird – the files are there, I'm not sure why it's complaining.

What command are you running to trigger the error?

Ugh, that's so weird – the files are there, I'm not sure why it's complaining.

What command are you running to trigger the error?

We are just running CMD [ "node", "./srv/prod.js" ] in our container to start our services and that output above is all we are receiving. The snippet above is the very top of the output.

Is there a way I can reproduce it? Everything I'm trying seems to be working ok:

$ docker run --rm mhart/alpine-node:10.16.0 node -p 'new Date().toString()'
Thu Jul 25 2019 01:34:29 GMT+0000 (Coordinated Universal Time)

(also, I just pushed up a new image in case the last one got corrupted on push somehow – try pulling again and let me know if it works)

With 8:

$ docker run --rm mhart/alpine-node:8.16.0 node -p 'new Date().toString()'
Thu Jul 25 2019 01:35:34 GMT+0000 (UTC)

Just rebuilt my images again with the latest push and it is running now. I would assume something got corrupted on the push as you mentioned.

It seems to be working with our builds now as well. Thanks for the quick response @mhart. I'll close this seeing that it was fixed with db34b8a

Thanks for the updates @tegamckinney and @ajkamel 👍