awsome-distributed-training icon indicating copy to clipboard operation
awsome-distributed-training copied to clipboard

Sh bad substition error

Open sean-smith opened this issue 1 year ago • 0 comments

If you see the following error when building a dockerfile:

sh: 1: Bad substitution

It's likely caused by your dockerfile running sh and not bash which doesn't support variables with v. such as the version of AWS OFI NCCL:

https://github.com/aws-samples/awsome-distributed-training/blob/9fc4e12afdabc29eac4be0d7aa03fa7623295bfc/3.test_cases/1.megatron-lm/0.distributed-training.Dockerfile#L71

The solution is to set the shell in your Dockerfile:

SHELL ["/bin/bash", "-c"]

sean-smith avatar Jun 05 '24 20:06 sean-smith