soudis / datencockpit-docker

Dockerversion von Datencockpit (www.datencockpit.at)
GNU General Public License v3.0
5 stars 1 forks source link

Problem with the docker-compose version #4

Open ovizii opened 6 years ago

ovizii commented 6 years ago

I "slightly" adapted the docker-compose.yml file but when trying the

docker-compose build command I get this error:

docker-compose build
ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

Any advice?

docker -v
Docker version 18.03.1-ce, build 9ee9f40
soudis commented 6 years ago

does your adapted docker-compose.yml file start with the version reference? like:

version: '3'

ovizii commented 6 years ago

sorry, my mistake I should have provided that info.

version: '3'

services:

  db:
    image: mariadb
    restart: always
    volumes:
      - /home/ovi/docker/datencockpit/datencockpit-db:/var/lib/mysql
      - ./kdz_datencockpit.sql:/docker-entrypoint-initdb.d/kdz_datencockpit.sql
    environment:
      - MYSQL_ROOT_PASSWORD=secret
      - MYSQL_DATABASE=kdz_datencockpit
      - MYSQL_USER=kdz_datencockpit
      - MYSQL_PASSWORD=secret
    logging:
      options:
        max-size: 50m

  datencockpit:
    build:
      context: .
      args:
        DATENCOCKPIT_SITENAME: "Datencockpit"
        DATENCOCKPIT_URL: "https://dsgvo.mydomain.tld"
        DATENCOCKPIT_EMERGENCY_CONTACT: "ovidiu@mydomain.tld"
        DATENCOCKPIT_DB_HOST: "db"
        DATENCOCKPIT_DB_NAME: "kdz_datencockpit"
        DATENCOCKPIT_DB_USER: "kdz_datencockpit"
        DATENCOCKPIT_DB_PASSWORD: "secret"
    restart: always
    volumes:
      - /home/ovi/docker/datencockpit/datencockpit-html:/var/www/html
    depends_on:
      - db
    links:
      - db:db
    ports:
      - 80:80
    logging:
      options:
        max-size: 50m
soudis commented 6 years ago

hmm, looks good... maybe your docker-compose version is too old, what's

docker-compose -v

saying? It needs to be 1.10.0 or newer (from what I know). If yours is older try changing the "version" in your docker-compose.yml to "2" and see if it still works (I haven't tried) or update your docker-compose.

ovizii commented 6 years ago
docker-compose -v
docker-compose version 1.8.0, build unknown

Docker is installed on Debian from repositories according to: https://docs.docker.com/install/linux/docker-ce/debian/

I replaced '3' with '2' and the build process succeeds. "Seems" to be working fine.

soudis commented 6 years ago

Very good, as I do not use any features of docker compose version "3" I changed the verison of the template to "2" also.