Solution :
I have enough experience in Docker to help you in fixing your error.
Your error invalid reference format
clearly suggests that the docker cannot convert a string which you are providing to the image. It can be the invalid name or the from the parsing error earlier in your docker run
command line if you are running the image in that way. With your compose file if you are trying to expand your variable in your image name then I think that variable is not expanding properly.
If you are using the docker run
command line then this error will pop up for not quoting your parameters properly with spaces and also mistaking a order of your command line.
Your command line is ordered as below :
docker ${args_to_docker} run ${args_to_run} image_ref ${cmd_to_exec}
Now the most common error in passing the arguments to your run is the volume mapping while expanding the path name which includes the space in it and also not quoting your path or escaping your space.
Please find below the example:
docker run -v $(pwd):/data image_ref
And proper fix is as below:
docker run -v "$(pwd):/data" image_ref