Jas
Jas

Reputation: 15113

how to run jekyll with docker compose getting - Unsupported config option for services: 'site'

I looked at: jekyll guide for installing with docker and I see there:

services:
  site:
    command: jekyll serve
    image: jekyll/jekyll:latest
    volumes:
      - $PWD:/srv/jekyll
      - $PWD/vendor/bundle:/usr/local/bundle
    ports:
      - 4000:4000
      - 35729:35729
      - 3000:3000
      -   80:4000

and usage:

docker-compose run site jekyll new site

but when I create a docker-compose.yml with the above yaml and then run the command docker-compose run site jekyll new site I get:

$ docker-compose run site jekyll new site
ERROR: The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services: 'site'

what did i miss from the guide or what am i doing wrong?

Upvotes: 0

Views: 653

Answers (1)

Andrew Graham-Yooll
Andrew Graham-Yooll

Reputation: 2258

Try:

version: '3.2'

services:
  site:
    command: jekyll serve
    image: jekyll/jekyll:latest
    volumes:
      - $PWD:/srv/jekyll
      - $PWD/vendor/bundle:/usr/local/bundle
    ports:
      - 4000:4000
      - 35729:35729
      - 3000:3000
      - 80:4000

Your issue:

You didn't declare a version at the top of your compose file which is mandatory for docker-compose. It should be compatible with the version of docker you are running. You can find more info here

Upvotes: 2

Related Questions