CircleCI Ideas

`set -e` per default

As of right now the default `CMD` for CircleCI's Docker Images is simply `CMD ["/bin/sh"]` (see here).

I propose to change this to `CMD ["/bin/sh", "-e"]` per default to ensure that multi-line commands fail when an intermediate step fails. This is such a common problem that there is a support article in "Troubleshooting and Known Issues" explaining that `set -e` should be used for multi-line commands. This change would would remove the need for setting `-e` "manually" and as such remove a potential source of errors.

It seems that this has been considered in the past- and maybe was even part of CircleCI 2.0 - but as can be seen in the linked Dockerfile this is no longer the case.

  • Avatar32.5fb70cce7410889e661286fd7f1897de Guest
  • Sep 9 2019
  • New
  • Attach files
  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    09 Sep 14:13

    I just noticed that according to the build logs the commands are run with `/bin/bash -eo pipefail` but I'm unable to determine where this "comes from". If that's the case please ignore this request.

  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    09 Sep 14:16

    Please ignore this request, I've verified that -e is set by default although I'm unsure where exactly this happens.