deno_docker icon indicating copy to clipboard operation
deno_docker copied to clipboard

Deno + Node alpine image not working with deno-bin

Open cimchd opened this issue 1 year ago • 1 comments

I need an alpine docker image with deno and node for our monorepo. We still have some node scripts, so we need both. I tried the following:

FROM node:20-alpine3.20

COPY --from=denoland/deno:bin-2.0.2 /deno /usr/local/bin/deno

RUN apk --update add libc6-compat

But it did not work. I think the problem ist, that the deno bin is compiled against glibc and won't work with alpines musl-libc, I tried to solve this problem with lib6-compat but this did not work.

I think the best solution woul be to add extra bin images for alpine: e.g. denoland/deno:bin-2.0.2-alpine

cimchd avatar Oct 25 '24 06:10 cimchd

# https://github.com/denoland/deno_docker/blob/main/alpine.dockerfile
COPY --from=gcr.io/distroless/cc --chown=root:root --chmod=755 /lib/*-linux-gnu/* /usr/local/lib/
COPY --from=gcr.io/distroless/cc --chown=root:root --chmod=755 /lib/ld-linux-* /lib/
COPY --from=denoland/deno:bin-2.1.4 /deno /bin/deno
RUN mkdir /lib64 && ln -s /usr/local/lib/ld-linux-* /lib64/
ENV LD_LIBRARY_PATH="/usr/local/lib"

this fixed the issue for me

Screenshot 2024-12-23 at 10 50 08

ije avatar Dec 23 '24 02:12 ije