-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Alpine/APK package for Deno #240
Comments
Have you considered using deno's docker image? https://hub.docker.com/r/denoland/deno |
Also i believe denoland/deno#3711 should be resolved first |
Using the |
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. 🙂 |
I was thinking something more like https://github.com/denoland/deno_docker#using-your-own-base-image |
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). |
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 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:
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 |
I have moved this to |
I finally managed to get Deno installed into an existing Alpine image without too much complexity. Piggybacking on the 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 |
Using Deno inside of an Alpine docker image is currently not super easy because you need to manually install it and add it to the path. If there were an Alpine APK package for it, it could be a simple matter of adding the following to your Dockerfile:
RUN apk add deno
This would be incredibly valuable for my team since we use Deno scripts in lots of places where we'd normally use Bash scripts. Since build processes are often complex, require multiple commands, and need to run on different environments, scripts are an ideal way to run them. We absolutely loathe writing Bash scripts, and the sooner we can get Deno into an environment so we can stop defaulting to Bash, the happier we are.
The text was updated successfully, but these errors were encountered: