Fixed – Docker Compose & Invalid Volume Specification


This blog presents solution to the error “Invalid Volume Specification” when executing “docker-compose up” command.

I got the error when the volume specification in docker-compose.yml file looks like following:

– ./conf/spark-master:/conf
– ./data:/tmp/data

Following is how error may look like:

ERROR: for spark-master Cannot create container for service spark-master: Invalid bind mount spec “c:\\Users\\ashukla\\dockers\\spark\\conf\\spark-master:/conf:rw”: Invalid volume specification: ‘c:\Users\ashukla\dockers\spark\conf\spark-master:/conf:rw’ ←[31mERROR←[0m: Encountered errors while bringing up the project.

The solution to this is following:

  • Save a file named as “.env” in the same folder as docker-compose.yml
  • Save the following in “.env” file: COMPOSE_CONVERT_WINDOWS_PATHS = 1


Ajitesh Kumar

Ajitesh Kumar

Ajitesh has been recently working in the area of AI and machine learning. Currently, his research area includes Safe & Quality AI. In addition, he is also passionate about various different technologies including programming languages such as Java/JEE, Javascript and technologies such as Blockchain, mobile computing, cloud-native technologies, application security, cloud computing platforms, big data etc.

He has also authored the book, Building Web Apps with Spring 5 and Angular.
Ajitesh Kumar

Leave A Reply

Time limit is exhausted. Please reload the CAPTCHA.