denoland / deno_docker

Latest dockerfiles and images for Deno - alpine, centos, debian, ubuntu
https://hub.docker.com/r/denoland/deno
MIT License
883 stars 101 forks source link

Bash function not working as intended from the documentation #301

Closed aminnairi closed 1 year ago

aminnairi commented 1 year ago

The documentation's example on how to use deno as a bash function is missing the entrypoint since running the current code snippet will fail as --version is not a known command inside the running container (because it lacks an entrypoint).

deno () {
  docker run \
    --interactive \
    --tty \
    --rm \
    --volume $PWD:/app \
    --volume $HOME/.deno:/deno-dir \
    --workdir /app \
    denoland/deno:1.10.3 \
    "$@"
}

Whereas this configuration will work.

deno () {
  docker run \
    --interactive \
    --tty \
    --rm \
    --volume $PWD:/app \
    --volume $HOME/.deno:/deno-dir \
    --workdir /app \
    --entrypoint deno \
    denoland/deno:1.10.3 \
    "$@"
}

Note the added --entrypoint deno line near the end of the bash function.