This project is just for exploring what a to-image (s2i) might look like for Deno applications.The idea here is that the s2i will provide the Deno runtime, and take a users Typescript application and bundle
This project is just for exploring what a to-image (s2i) might look like for Deno applications.
Build this image:
$ podman build -t nodeshift/ubi8-s2i-deno .
Run the image:
$ podman run -it localhost/ubi8-s2i-deno /bin/bash
Build an s2i example-app, specifying which Typescript file is the main entry point using the
MAIN build argument, and also shows how a PERMISSION option can be passed to the build.:
$ cd example-app $ podman build . --build-arg MAIN=welcome.ts --build-arg PERMISSIONS="--allow-read=/etc" -t app
PERMISSION build argument is an example of using Deno's permissions to allow the application to read from the file system. Without this flag the an error would be produced at runtime:
error: Uncaught PermissionDenied: read access to "/etc/passwd", run again with the --allow-read flag at processResponse (core.js:226:13) at Object.jsonOpSync (core.js:250:12) at Object.lstatSync (deno:cli/rt/30_fs.js:216:22) at Object.existsSync (file:///opt/app-root/src/main.js:11267:18) at execute (file:///opt/app-root/src/main.js:11300:65) at gExp (file:///opt/app-root/src/main.js:91:7) at __instantiate (file:///opt/app-root/src/main.js:98:27) at file:///opt/app-root/src/main.js:11305:1
Running the example app:
$ podman run -t localhost/app Welcome to Deno(14:24) 🦕 Does /etc/passwd exist: true
A TypeScript configuration can be passed to Deno's bundle command using the following option:
$ podman build . --build-arg MAIN=welcome.ts --build-arg TSCONFIG="tsconfig.json"
tsconfig.json file must be copied to the image, so it need to be added in the DockerFile that uses/extends this image.
Source Code: https://github.com/danbev/ubi8-s2i-deno
Deno is released, it’s time to find out if it can prove a worthy competition for Node.js. What is Deno? Why Deno can be considered an alternative to Node? The main differences between Deno and Node. Write a simple Deno app.