ERROR: In file './docker-compose.yml', service must be a mapping, not a NoneType

0

I am creating a docker-compose.yml, I see no problem in the file but every time I run the --build displays the error "setup this up without issue"

version: '3.3'

services:

web1:
image: docker_micro
container_name: web1
ports:
- "1000:8080"

web2:
image: docker_micro
container_name: web2
ports:
- "2000:8080"

web3:
image: docker_micro
container_name: web3
ports:
- "3000:8080"

haproxy:
build: ./proxy
container_name: haproxy
ports:
 - "8080:8080"

What will be the problem?

    
asked by Luis 17.05.2018 в 19:20
source

1 answer

1

The file format for Docker Compose uses YAML , therefore, you need to correctly devise the file:

version: '3.3'

services: 
  web1:
    image: docker_micro
    container_name: web1
    ports:
      - "1000:8080"
  web2:
    image: docker_micro
    container_name: web2
    ports:
      - "2000:8080"    
  web3:
    image: docker_micro
    container_name: web3
    ports:
      - "3000:8080"
  haproxy:
    build: ./proxy
    container_name: haproxy
    ports:
       - "8080:8080"

This should be enough to make it work.

    
answered by 30.05.2018 в 20:39