Hi, I am trying to use the example provided in the site https://docs.docker.com/compose/gettingstarted/
Step 3: Define services Define a set of services using docker-compose.yml:
Create a file called docker-compose.yml in your project directory and add the following:
version: '2' services: web: build: . ports: - "5000:5000" volumes: - .:/code depends_on: - redis redis: image: redis
and when I run the command docker-compose up i got the below error
ERROR: yaml.scanner.ScannerError: while scanning for the next token found character ‘\t’ that cannot start any token in “./docker-compose.yml”, line 18, column 1 so i removed all spaces and modified it as below
version: ‘2’ services: web: build: . #Build from the dockerfile from current dir ports:
on trying it again i am getting an error now as
docker-compose up ERROR: In file ‘./docker-compose.yml’, service must be a mapping, not a NoneType.
Can I get some help what is wrong here… I am using MAC.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!