What is a recommended fast and slim Docker configuration for having both Node and Deno installed? Something like the following doesn't seem optimal... but I could be mistaken. Any advice would be greatly appreciated. Thank you!
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:16
ENV DENO_VERSION=v1.9.2
ENV DENO_INSTALL=/deno
RUN mkdir -p /deno \
&& curl -fsSL https://deno.land/x/install/install.sh -o install-deno.sh \
&& sh install-deno.sh ${DENO_VERSION} \
&& chown -R node /deno \
&& chmod -R 777 /deno \
&& rm install-deno.sh
ENV PATH=${DENO_INSTALL}/bin:${PATH} \
DENO_DIR=${DENO_INSTALL}/.cache/deno
RUN npm i -g typescript
The fact that Deno is designed as a single executable makes installation and deployment exceptionally flexible. I think your method is fine, but if you simply want a reference to boost your confidence, take a look at the "official" dockerfiles in the denoland repo: https://github.com/denoland/deno_docker
I stumbled upon this question trying to achieve the same thing, then found out that there is now a documented way to do this cleanly : https://github.com/denoland/deno_docker?tab=readme-ov-file#using-your-own-base-image
This could look like that for the original example:
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:16
ENV DENO_VERSION=1.9.2
COPY --from=denoland/deno:bin-${DENO_VERSION} /deno /usr/local/bin/deno
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With