At the end of a Dockerfile that defines a container for a Sagemaker training job, you have to define the SAGEMAKER_PROGRAM environment variable. It needs to point directly to the script that acts as the entry point as it exists within /opt/ml/code, rather than the full path.

ENV SAGEMAKER_PROGRAM train.py