deno_docker icon indicating copy to clipboard operation
deno_docker copied to clipboard

devcontainer with denoland/deno:alpine not working

Open cirolosapio opened this issue 1 year ago • 9 comments

using denoland/deno:alpine as a base image to run a devcontainer run in this error:

Error relocating /usr/local/lib/libgcc_s.so.1: _dl_find_object: symbol not found
Error relocating /usr/local/lib/libgcc_s.so.1: __cpu_indicator_init: symbol not found
Error relocating /usr/local/lib/libgcc_s.so.1: __cpu_model: symbol not found

cirolosapio avatar Jun 11 '24 20:06 cirolosapio

Probably vscode depends on glibc, and thus can not run on alpine. I don't think these errors come from Deno.

lucacasonato avatar Jun 13 '24 13:06 lucacasonato

no vscode does not require gclib afaik if you use alpine image instead it works

using this reproduction check compose.yml and try switching image from alpine and denoland/deno:alpine

cirolosapio avatar Jun 13 '24 14:06 cirolosapio

i just ran into a similar issue on denoland/deno:alpine trying to use ffmpeg.

❯ docker run --rm -it denoland/deno:alpine sh

/ # apk add ffmpeg

[...]

/ # ffmpeg
Error relocating /usr/local/lib/libgcc_s.so.1: _dl_find_object: symbol not found

works fine on the regular alpine image

vaaski avatar Oct 18 '24 20:10 vaaski

I'm also getting similar errors due to switching to denoland/deno:alpine-2.0.3 from alpine:3.20.3, when using php:

PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick' (tried: /usr/lib/php83/modules/imagick (Error loading shared library /usr/lib/php83/modules/imagick: No such file or directory), /usr/lib/php83/modules/imagick.so (Error relocating /usr/local/lib/libgcc_s.so.1: __cpu_indicator_init: symbol not found)) in Unknown on line 0

this is a serious issue

jd1378 avatar Oct 29 '24 16:10 jd1378

https://github.com/denoland/deno_docker/issues/350 is probably related

jd1378 avatar Oct 29 '24 16:10 jd1378

Also facing this issue.

RUN apk update && apk add --no-cache npm
RUN npm install pnpm yarn -g
 > [11/18] RUN npm install pnpm yarn -g:
0.408 Error relocating /usr/local/lib/libgcc_s.so.1: _dl_find_object: symbol not found
0.408 Error relocating /usr/local/lib/libgcc_s.so.1: __cpu_indicator_init: symbol not found
0.408 Error relocating /usr/local/lib/libgcc_s.so.1: __cpu_model: symbol not found
------
Dockerfile:27
--------------------
  25 |     ENV DENO_DIR=/usr/builds/deno-cache
  26 |     RUN apk update && apk add --no-cache npm
  27 | >>> RUN npm install pnpm yarn -g
  28 |     # DOCKERFILE-X:END file="./deno" includedBy="dockerfile_1730902581" includeType="include"
  29 |     # DOCKERFILE-X:START file="./base-after" includedBy="dockerfile_1730902581" includeType="include"
--------------------
ERROR: failed to solve: process "/bin/sh -c npm install pnpm yarn -g" did not complete successfully: exit code: 127

Meldiron avatar Nov 06 '24 14:11 Meldiron

@Meldiron which version of the dockerfile are you using?

bartlomieju avatar Nov 06 '24 16:11 bartlomieju

I'm hitting this issue too when trying to run lftp on the denoland/deno:alpine-2.1.3 image.

I was able to work around it by updating the LD_LIBRARY_PATH environment variable. It looks like the base deno alpine Docker image has LD_LIBRARY_PATH=/usr/local/lib which points to the libgcc_s.so.1 that is causing issues. On a plain alpine:3 Docker image it looks like lftp is linked to /usr/lib/libgcc_s.so.1 instead.

So by setting LD_LIBRARY_PATH=/usr/lib when running lftp I was able to run it in the Deno image without issue.

Interestingly, after updating the LD_LIBRARY_PATH deno also seemed to run fine, and when looking at the deno binary with ldd it looks like it's also failing to find some symbols in /usr/local/lib/libgcc_s.so.1 🤔

This is a bit above my pay grade so I'm not exactly sure of the repercussions, but could this potentially be resolved by not providing a custom libgcc in the base Dockerfile and instead using the one from /usr/lib (which I assume is being installed from apk)

Tate-CC avatar Dec 12 '24 20:12 Tate-CC

I was having some trouble getting the VSCode Remote Server to run with Deno in the official image. At first I had installed gcompat and gotten the VSCode server working, but that broke Deno, after reading @Tate-CC 's answer I realized I could just use the following and got both of them working.

ENV LD_LIBRARY_PATH /usr/lib:/usr/local/lib

deveyus avatar Dec 28 '24 04:12 deveyus