Sign inSign up

hayd/ubuntu-deno

By hayd

Updated over 5 years ago

Deno on Ubuntu

Image
2

10K+

hayd/ubuntu-deno repository overview

ANNOUNCEMENT

hayd/deno docker images have now been moved into the official denoland repository https://hub.docker.com/r/denoland/deno.

These images will no longer be updated. Please update your dockerfiles to use denoland/deno:ubuntu.



Ubuntu Deno

https://github.com/hayd/deno-docker

Run locally:

To run main.ts from your working directory:

$ docker run -it --init -p 1993:1993 -v $PWD:/app hayd/ubuntu-deno:1.5.2 run --allow-net /app/main.ts

Here, -p 1993:1993 maps port 1993 on the container to 1993 on the host, -v $PWD:/app mounts the host working directory to /app on the container, and run --allow-net /app/main.ts is passed to deno on the container.

As a Dockerfile

FROM hayd/ubuntu-deno:1.5.2

EXPOSE 1993  # The port that your application listens to.

WORKDIR /app

# Prefer not to run as root.
USER deno

# Cache the dependencies as a layer (the following two steps are re-run only when deps.ts is modified).
# Ideally fetch deps.ts will download and compile _all_ external files used in main.ts.
COPY deps.ts .
RUN deno cache deps.ts

# These steps will be re-run upon each file change in your working directory:
ADD . .
# Compile the main app so that it doesn't need to be compiled each startup/entry.
RUN deno cache main.ts

CMD ["run", "--allow-net", "main.ts"]

and build and run this locally:

$ docker build -t app . && docker run -it --init -p 1993:1993 app

See example directory.

Note: Dockerfiles provide a USER deno and DENO_DIR is set to /deno-dir/ (which can be overridden).

Tag summary

Content type

Image

Digest

Size

58.7 MB

Last updated

over 5 years ago

docker pull hayd/ubuntu-deno