I started with a Dockerfile:
FROM alpine
RUN apk add libgcc libc6-compat && \
cd /root && \
wget https://github.com/denoland/deno/releases/download/v0.2.6/deno_linux_x64.gz && \
gunzip deno_linux_x64.gz && \
mv deno_linux_x64 /bin/deno && \
chmod +x /bin/deno
CMD [ "/bin/deno" ]
And build it with:
docker build -t sunfmin/deno .
Then I run:
$ docker run sunfmin/deno deno https://deno.land/thumb.ts
Error relocating /bin/deno: __rawmemchr: symbol not found
Error relocating /bin/deno: strtoll_l: symbol not found
Error relocating /bin/deno: strtoull_l: symbol not found
Error relocating /bin/deno: __register_atfork: symbol not found
Error relocating /bin/deno: __res_init: symbol not found
Error relocating /bin/deno: __isnan: symbol not found
Error relocating /bin/deno: __vfprintf_chk: symbol not found
Error relocating /bin/deno: __vsnprintf_chk: symbol not found
Error relocating /bin/deno: __isinf: symbol not found
Error relocating /bin/deno: __isnanf: symbol not found
Error relocating /bin/deno: backtrace: symbol not found
Error relocating /bin/deno: backtrace_symbols: symbol not found
I got this error: Error relocating /bin/deno: __res_init: symbol not found
If I do:
/ # ldd /bin/deno
/lib64/ld-linux-x86-64.so.2 (0x7f4d4c9a7000)
libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7f4d4c9a7000)
libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f4d4c9a7000)
librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x7f4d4c9a7000)
libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f4d4c9a7000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f4d4c795000)
libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f4d4c9a7000)
Error relocating /bin/deno: __rawmemchr: symbol not found
Error relocating /bin/deno: strtoll_l: symbol not found
Error relocating /bin/deno: strtoull_l: symbol not found
Error relocating /bin/deno: __register_atfork: symbol not found
Error relocating /bin/deno: __res_init: symbol not found
Error relocating /bin/deno: __isnan: symbol not found
Error relocating /bin/deno: __vfprintf_chk: symbol not found
Error relocating /bin/deno: __vsnprintf_chk: symbol not found
Error relocating /bin/deno: __isinf: symbol not found
Error relocating /bin/deno: __isnanf: symbol not found
Error relocating /bin/deno: backtrace: symbol not found
Error relocating /bin/deno: backtrace_symbols: symbol not found
What should I do to fix this?
You need glibc. See: https://github.com/hayd/deno_docker
That said, it should be possible to build a binary for alpine which doesn't require glibc...
(see also https://github.com/denoland/deno/issues/1456#issuecomment-451780202 )
It worked. Thanks!
Most helpful comment
You need glibc. See: https://github.com/hayd/deno_docker
That said, it should be possible to build a binary for alpine which doesn't require glibc...
(see also https://github.com/denoland/deno/issues/1456#issuecomment-451780202 )