Git Product home page Git Product logo

Comments (9)

stabai avatar stabai commented on May 27, 2024 3

I finally managed to get Deno installed into an existing Alpine image without too much complexity. Piggybacking on the deno:alpine image did work, there were just more resources that needed to be copied.

Here's what I did:

FROM denoland/deno:alpine-1.24.1 AS deno

FROM docker:20.10.16-dind-alpine3.16   # or whatever alpine base image you want
COPY --from=deno /bin/deno /usr/local/bin/deno
COPY --from=deno /usr/glibc-compat /usr/glibc-compat
COPY --from=deno /lib/* /lib/
COPY --from=deno /lib64/* /lib64/
COPY --from=deno /usr/lib/* /usr/lib/

Now works perfectly when running:

docker buildx build --platform=linux/amd64 . --tag test-deno-alpine
docker run -it --rm --entrypoint=deno --platform=linux/amd64 test-deno-alpine

from deno_docker.

AnInternetTroll avatar AnInternetTroll commented on May 27, 2024

Have you considered using deno's docker image? https://hub.docker.com/r/denoland/deno

from deno_docker.

AnInternetTroll avatar AnInternetTroll commented on May 27, 2024

Also i believe denoland/deno#3711 should be resolved first

from deno_docker.

stabai avatar stabai commented on May 27, 2024

Using the denoland/deno:alpine image may be an option, but when using this setup to build docker images, it means we also need docker-in-docker. The easiest way to do that is to start with the docker:dind image and add any additional tooling needed on top of that.

from deno_docker.

stabai avatar stabai commented on May 27, 2024

Of course, there may already be a good way to create this setup that I'm not aware of. If there is, providing it on the deno install site would also be awesome. 🙂

from deno_docker.

AnInternetTroll avatar AnInternetTroll commented on May 27, 2024

Using the denoland/deno:alpine image may be an option, but when using this setup to build docker images, it means we also need docker-in-docker. The easiest way to do that is to start with the docker:dind image and add any additional tooling needed on top of that.

I was thinking something more like https://github.com/denoland/deno_docker#using-your-own-base-image
Though i've never heard of dind

from deno_docker.

stabai avatar stabai commented on May 27, 2024

Whoops, I was not aware of that repository! This is definitely a good example to follow (though an APK would still be a welcomed simplification).

from deno_docker.

stabai avatar stabai commented on May 27, 2024

In case anyone else runs into this: The methodology on that page works great when using a base image with ubuntu, but I'm not able to get it to work on alpine. Running deno in the container results in errors about missing dependencies.

My dockerfile:

FROM denoland/deno:alpine-1.24.1 AS deno

FROM docker:20.10.17-alpine3.16
RUN apk add libgcc qemu
COPY --from=deno /tini /tini
COPY --from=deno /bin/deno /usr/local/bin/deno

(I also tried deno:bin and deno:distroless, no luck there either)

Built container and ran deno within it:

docker buildx build --platform=linux/amd64 . --tag test-deno-alpine
docker run -it --rm --entrypoint=deno --platform=linux/amd64 test-deno-alpine

I get the following errors:

Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /usr/local/bin/deno)
Error relocating /usr/local/bin/deno: __isnan: symbol not found
Error relocating /usr/local/bin/deno: __memcpy_chk: symbol not found
Error relocating /usr/local/bin/deno: backtrace: symbol not found
Error relocating /usr/local/bin/deno: backtrace_symbols: symbol not found
Error relocating /usr/local/bin/deno: __vfprintf_chk: symbol not found
Error relocating /usr/local/bin/deno: __vsnprintf_chk: symbol not found
Error relocating /usr/local/bin/deno: __mbrlen: symbol not found
Error relocating /usr/local/bin/deno: strtoll_l: symbol not found
Error relocating /usr/local/bin/deno: strtoull_l: symbol not found
Error relocating /usr/local/bin/deno: __memmove_chk: symbol not found
Error relocating /usr/local/bin/deno: __register_atfork: symbol not found
Error relocating /usr/local/bin/deno: gnu_get_libc_version: symbol not found
Error relocating /usr/local/bin/deno: __res_init: symbol not found

It looks like this is because glibc, and I'm not sure why that's so difficult to get to work properly on alpine. The deno:alpine image looks like it's using a base image that already has this resolved.

from deno_docker.

kitsonk avatar kitsonk commented on May 27, 2024

I have moved this to deno_docker as any solution should be addressed in this repo.

from deno_docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.