Default shell in Docker convenience images

The default shell in cimg/base and its derived images is the Debian Almquist Shell (dash), which does not support certain bash specific features such as brace expansion.

For example, the following command:

mkdir -p build/{assets,bin}

will result in a single directory named {assets,bin} instead of creating build/assets and build/bin.

This can lead to unexpected behavior if brace expansion is used in your Makefiles or in other build related scripts.

To fix this, explicitly set the shell to bash in your .circleci/config.yml:

- run:
shell: /bin/bash
command: mkdir -p build/{assets,bin}

Using bash ensures proper handling of brace expansion and other advanced shell features.

Additional Resources:

Was this article helpful?
3 out of 3 found this helpful

Comments

0 comments

Article is closed for comments.