Docker error: Cannot create container for service web: invalid mode Docker error: Cannot create container for service web: invalid mode apache apache

Docker error: Cannot create container for service web: invalid mode


Check your docker-compose.yml file. I recently had the same error, due to an extra space in the volume config:

  volumes:  - ./www:/home/distressedpro/public_html   - ./conf:/etc/apache2/sites-available

Note the extra space on the last line, that was causing the error. Correcting it to:

  volumes:  - ./www:/home/distressedpro/public_html  - ./conf:/etc/apache2/sites-available

fixed it