deno_docker icon indicating copy to clipboard operation
deno_docker copied to clipboard

Latest image (1.40.5) missing unzip

Open Guillaume-Mayer opened this issue 1 year ago • 4 comments

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

Guillaume-Mayer avatar Feb 21 '24 13:02 Guillaume-Mayer

Having the same issue with deno:1.41.0.

catuhana avatar Feb 23 '24 11:02 catuhana

Still failing with denoland/deno:1.41.3

Guillaume-Mayer avatar Mar 15 '24 01:03 Guillaume-Mayer

Without the unzip the compile does not work.

Is it a valid MR to be done?

fabricionaweb avatar May 29 '24 12:05 fabricionaweb

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

Guillaume-Mayer avatar May 30 '24 22:05 Guillaume-Mayer