denoland / deno_docker

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

Latest image (1.40.5) missing unzip #344

Open Guillaume-Mayer opened 5 months ago

Guillaume-Mayer commented 5 months ago

Using this dockerfile:

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"]

Give me this error:

1.970 Check file:///app/server.ts
3.351 Compile file:///app/server.ts to server
3.351 Download https://dl.deno.land/release/v1.40.5/denort-x86_64-unknown-linux-gnu.zip
15.84 error: Writing server
15.84
15.84 Caused by:
15.84     `unzip` was not found in your PATH, please install `unzip`
------
Dockerfile:4
--------------------
   2 |     WORKDIR /app
   3 |     ADD . /app
   4 | >>> RUN deno compile --allow-net server.ts
   5 |
   6 |     FROM gcr.io/distroless/cc-debian12:nonroot
--------------------
ERROR: failed to solve: process "/bin/sh -c deno compile --allow-net server.ts" did not complete successfully: exit code: 1

It works with tag 1.40.4

catuhana commented 5 months ago

Having the same issue with deno:1.41.0.

Guillaume-Mayer commented 4 months ago

Still failing with denoland/deno:1.41.3

fabricionaweb commented 1 month ago

Without the unzip the compile does not work.

Is it a valid MR to be done?

Guillaume-Mayer commented 1 month ago

Since deno use unzip, I would think it should be in the image. On the other hand, it is not welcome at runtime, so I don't know, but in my case I dit this:

FROM denoland/deno
WORKDIR /app
ADD . /app
RUN : \
 && apt-get update \
 && apt-get install -y unzip \
 && deno compile --allow-net server.ts

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

Maybe I could just use the denoland/deno:distroless variant tho