Comments (9)
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.
Have you considered using deno's docker image? https://hub.docker.com/r/denoland/deno
from deno_docker.
Also i believe denoland/deno#3711 should be resolved first
from deno_docker.
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.
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.
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 thedocker: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.
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.
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.
I have moved this to deno_docker
as any solution should be addressed in this repo.
from deno_docker.
Related Issues (20)
- Tini warning when building 1.28.1 image HOT 3
- Containers for 1.30.0 have Deno CLI version 1.29.4 HOT 2
- Add release workflow HOT 1
- Cache not caching all deps? HOT 10
- Become a docker verified publisher
- Use Docker official actions
- Document tini HOT 3
- Bash function not working as intended from the documentation
- No tag for 1.36.2 HOT 1
- Permission denied (os error 13) when writing to file from Dockerfile
- Simple express app segfaults in alpine Docker image HOT 2
- Docker sponsorship and/or alternate container registry options HOT 1
- Proposal: Distroless and Alpine image improvements. HOT 3
- Add ARM64 platform to docker images HOT 1
- Alpine ARM64 docker container broken HOT 1
- Latest image (1.40.5) missing unzip HOT 2
- Unable to pull v1.40.5 HOT 2
- Latest image broke nodejs / npm usage (maybe related to libgcc) HOT 5
- Automate tagging
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deno_docker.