denoland / deno_docker

Latest dockerfiles and images for Deno - alpine, centos, debian, ubuntu
https://hub.docker.com/r/denoland/deno
MIT License
883 stars 101 forks source link

Proposal: Distroless and Alpine image improvements. #324

Open dojyorin opened 9 months ago

dojyorin commented 9 months ago

I think there are some issues with Dockerfiles in this repository (especially Alpine and Distroless).

And I came up with some solutions and published in my repository and DockerHub.

Quote from my repository:

This project was created to solve the problems faced by deno_docker official images.

  • tini is redundant
  • Alpine dependent on third-party image
  • Using old debian in Distroless (Uses 11, latest is 12)

If my approach is of positive to everyone, I would like to contribute to this repository.

But since I'm beginner, I'd like to hear everyone's opinions first.

guillaume86 commented 7 months ago

About removing tini, on one hand it makes a cleaner Dockerfile/image, but OTOH all your users have to remember to use --init and it's one more barrier to a smooth experience, and removing it now would be a breaking change IMO. Having up to date alpine images would be great though :).

Guillaume-Mayer commented 7 months ago

Not sure if it helps, but this works for me:

FROM denoland/deno
WORKDIR /app
ADD . /app
RUN deno compile --allow-net server.ts

FROM gcr.io/distroless/cc-debian12:nonroot
COPY --from=0 /app/server /home/nonroot/server
ENTRYPOINT ["./server"]
mmastrac commented 7 months ago

@dojyorin If you would like to PR support for using alpine:latest with glibc from distroless and the existing tini setup, I think that would be a PR we could accept.

Removing tini would be a different discussion, but our Alpine support could definitely be improved.