telus-agcg / nib

A Docker Compose wrapper geared towards Ruby/Rails development with a focus on: convention, convenience and productivity.
MIT License
15 stars 3 forks source link

Support images with an ENTRYPOINT for `shell` command #145

Closed johnallen3d closed 7 years ago

johnallen3d commented 7 years ago

The new and improved shell command will now generate a statement that looks like this:

docker-compose \
  -f /tmp/nib/compose20170605-237-1y7p1o1 \
  run \
  --rm \
  --entrypoint='
    /bin/sh -c "
      export HISTFILE=/usr/local/history/shell_history
      cp /tmp/nib/config/irbrc /root/.irbrc 2>/dev/null
      cp /tmp/nib/config/pryrc /root/.pryrc 2>/dev/null
      if [ -f bin/shell ]; then bin/shell;
      elif hash zsh 2>/dev/null ; then zsh;
      elif hash bash 2>/dev/null ; then bash;
      elif hash ash 2>/dev/null ; then ash;
      else sh; fi
      "
  ' \
  web \
  /bin/sh -c "
    export HISTFILE=/usr/local/history/shell_history
    cp /tmp/nib/config/irbrc /root/.irbrc 2>/dev/null
    cp /tmp/nib/config/pryrc /root/.pryrc 2>/dev/null
  "

Not that the trailing "CMD" will be completely ignored because the ENTRYPOINT does not accept arguments. I believe this is desired and is essentially the current behavior.

Resolves #143