Skip to content

dojyorin/deno_docker_image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Deno Docker Image

actions:test actions:release actions:cron shields:license shields:release

The simple and small deno docker image.

This image is published on DockerHub and synchronized with latest version of denoland/deno every day at 00:00 UTC.

Now, let's start using it!

Tags

OS Tag Arch
distroless (default) latest vX.Y.Z distroless distroless-vX.Y.Z amd64 arm64
alpine alpine alpine-vX.Y.Z amd64 arm64

How to use

Easy to introduce in your project.

⚠ Note ⚠

  • When starting container, be sure to add --init flag (docker run) or init: true property (docker-compose.yml) to avoid PID1 problem.
  • For security reasons, default runtime user is nonroot in distroless and nobody in other distributions.

As single image

# Run REPL.
docker run --rm --init -it dojyorin/deno:latest

# Run script.
docker run --rm --init --restart always -p 0.0.0.0:5000:8000 -v $(pwd)/src:/data:ro dojyorin/deno:latest run /data/main.ts

As compose

name: my_project
services:
    image: dojyorin/deno:latest
    init: true
    restart: always
    ports:
        - 0.0.0.0:5000:8000
    volumes:
        - ./src:/data:ro
    command:
        - run
        - /data/main.ts

As base image

FROM dojyorin/deno:latest
COPY ./src /data
EXPOSE 8000
CMD ["run", "/data/main.ts"]

Difference with official image

This project was created to solve some issues by deno_docker official images.

  • tini is redundant
  • Alpine dependent on third-party image
  • Using old debian in Distroless (Uses 11, latest is 12)

If official images solve those issues, this project will be unnecessary...