Coder Social home page Coder Social logo

Comments (8)

Minigugus avatar Minigugus commented on April 28, 2024 3

@DanielRamosAcosta Oh nice 😮 Pretty cool to bypass --entrypoint easly 😆

@hayd Currently, docker run -it --rm hayd/deno:alpine-0.35.0 bash runs deno bash. docker-entrypoint.sh solve the problem by detecting that bash is a command name, so it just run bash, but still runs deno bash.ts in docker run -it --rm hayd/deno:alpine-0.35.0 bash.ts for instance. --entrypoint is cool but it doesn't make it easy to pass command lines not using deno. Also, some users can be confused not passing the command name (deno) in the command line. 😉

from deno_docker.

hayd avatar hayd commented on April 28, 2024 2

something like this?

#!/bin/bash
set -e

# how to test if $1 is in (run, cache, bundle, completions, eval, fmt, lint, repl, test, types) ?
if [ "$1" = 'run' ]; then
    exec gosu deno "$@"
fi

exec "$@"

https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#entrypoint

from deno_docker.

hayd avatar hayd commented on April 28, 2024 1

One annoying part of this is that test is a unix command so this would be breaking (at the moment running test would run deno test). I wonder if there is a workaround for that part 🤔

from deno_docker.

Minigugus avatar Minigugus commented on April 28, 2024 1

It's possible to hard-code Deno commands in docker-entrypoint.sh... 😕

from deno_docker.

DanielRamosAcosta avatar DanielRamosAcosta commented on April 28, 2024 1

Give me some time, I'll try to prepare a PR during this week 😄 , thanks you all @Minigugus @hayd

from deno_docker.

Minigugus avatar Minigugus commented on April 28, 2024 1

@hayd

how to test if $1 is in (run, cache, bundle, completions, eval, fmt, lint, repl, test, types) ?

#!/bin/bash
set -e

case "$1" in
    run | \
    cache | \
    bundle | \
    completions | \
    eval | \
    fmt | \
    lint | \
    repl | \
    test | \
    types) \
    exec gosu deno "$@";;
esac

exec "$@"

from deno_docker.

hayd avatar hayd commented on April 28, 2024

Thanks for opening an issue / bringing this up!

Could you explain the benefit? What is it solving? How would this change the usage? (How do you call bash in the node image?)

Why doesn't --entrypoint suffice? Why does it break gitlab?

This was suggested and introduced by @Minigugus in #23. Would be interested to hear their counter.

I'm not adverse to this change, but I did think it was neat... But I just want to understand more fully.

from deno_docker.

hayd avatar hayd commented on April 28, 2024

@DanielRamosAcosta Happy to take PR!

from deno_docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.