Docker generates an "In file" error. / docker -compose.yml ', service "punjab" should be a display, not a string. "

I get a strange error in the docker-compose.yml file.

I prepared a file for linking files for TCPjab, ejabberd, and mysql connection manager.

Below is the docker-compose.yml file

version: '2'
services:
  punjab:
    image:punjab
    ports
     - 5280:5280
    links
     - ejabbberd:ejabberd
  ejabberd:
    image: ejabberd
    depends-on:
      - mysql
    links:
      - mysql:mysql
  mysql:
    image:mysql

When I run the docker-compose command from the command line and from the same directory where I have the docker-compose.yml file, I get the following error.

ERROR: In the file './docker-compose.yml' the service 'punjab' must not be a string match.

I parsed the yml file using yamllint and the file was formatted correctly.

+4
1

, , .

:

  • depends_on depends-on, .

  • , , : image: punjab.

  • ports links punjab :

  • ejabberd punjab Docker Hub, .

docker-compose.yml:

version: '2'
services:
  punjab:
    image: punjab
    ports:
      - "5280:5280"
    links:
      - ejabberd

  ejabberd:
    image: ejabberd
    depends_on:
      - mysql
    links:
      - mysql

  mysql:
    image: mysql
+9

All Articles