inviqa / dock-cli

Dock CLI
MIT License
39 stars 14 forks source link

dock-cli docker:install fails with gnu-sed installed #44

Closed alistairstead closed 9 years ago

alistairstead commented 9 years ago

This is caused by the differing parameter order between sed implementations. I normally install gnu-sed so that it matches other implementations.

RUN sed -i '' 's/docker/zzz-dinghy/' /usr/local/Cellar/dinghy/3.0.1/cli/dinghy/dnsmasq.rb
ERR sed: can't read s/docker/zzz-dinghy/: No such file or directory

  [Symfony\Component\Process\Exception\ProcessFailedException]
  The command "sed -i '' 's/docker/zzz-dinghy/' /usr/local/Cellar/dinghy/3.0.1/cli/dinghy/dnsmasq.rb" failed.
  Exit Code: 2(Misuse of shell builtins)
  Output:
  ================
  Error Output:
  ================
  sed: can't read s/docker/zzz-dinghy/: No such file or directory

Uninstalling gnu-sed resolves the issue however a system check to evaluate the version of sed installed and construct the command accordingly may avoid recurring issues with new users.

sroze commented 9 years ago

So we have 2 options:

  1. Based on the experiment I made, we can check if the result of sed --version contains "GNU sed". Important, the sed --version command with OSX is failing so we need to silent the error and conclude that the version used in the OSX one.
  2. As this sed command is only used to fix the code source of dinghy to change the name of the DNS masq they are using, we may use another solution than this one or better, contribute a --no-dns option to dinghy.