Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

[BUG] Additional properties are not allowed ('start period' was unexpected) when using docker-compose #64

Closed
urinal-cake opened this issue Jan 14, 2020 · 3 comments
Labels
wontfix This will not be worked on

Comments

@urinal-cake
Copy link

This may not fully be a bug, but instead a case of User Error. However, if it's not, then the issue I'm running into may be remedied with better instructions.

Describe the bug
When starting the docker containers with the command 'docker-compose up -d' docker states that the docker-compose file is invalid because all three services with healthcheck parameters defined in the docker-compose, have invalid syntax.

To Reproduce
Steps to reproduce the behaviour:

  1. sudo git clone https://github.com/tobybatch/kimai2.git kimai
  2. sudo cd /opt/kimai
  3. docker-compose up -d
  4. Notice the following errors are displayed:

ERROR: The Compose file './docker-compose.yml' is invalid because: > services.kimai.healthcheck value Additional properties are not allowed ('start_period' was unexpected)
services.nginx.healthcheck value Additional properties are not allowed ('start_period' was unexpected)
services.sqldb.healthcheck value Additional properties are not allowed ('start_period' was unexpected)

Desktop (please complete the following information):

  • OS: Ubuntu 18.04 bionic
  • Docker version: 19.03.5
  • Docker compose version: 1.17.1

Command used to run the container

  • docker-compose up -d

Docker compose file (with passwords redacted)

version: '3.5'
services:

  sqldb:
    image: mysql:5.7
    environment:
      - MYSQL_DATABASE=kimai
      - MYSQL_USER=kimaiuser
      - MYSQL_PASSWORD=kimaipassword
      - MYSQL_ROOT_PASSWORD=changemeplease
    volumes:
      - /var/lib/mysql
    command: --default-storage-engine innodb
    restart: unless-stopped
    healthcheck:
      test: mysqladmin -pchangemeplease ping -h localhost
      interval: 20s
      start_period: 10s
      timeout: 10s
      retries: 3 

  nginx:
    build: compose
    ports:
      - 8001:80
    volumes:
      - ./nginx_site.conf:/etc/nginx/conf.d/default.conf
    restart: unless-stopped
    depends_on:
      - kimai
    volumes:
      - public:/opt/kimai/public
    healthcheck:
      test:  wget --spider http://nginx/health || exit 1 
      interval: 20s
      start_period: 10s
      timeout: 10s
      retries: 3 

  kimai:
    image: kimai/kimai2:fpm-alpine-1.5-prod
    environment:
      - APP_ENV=prod
      - TRUSTED_HOSTS=localhost
      - ADMINMAIL=admin@kimai.local
      - ADMINPASS=changemeplease
    volumes:
      - public:/opt/kimai/public
      - var:/opt/kimai/var
    restart: unless-stopped
    healthcheck:
      test: wget --spider http://nginx || exit 1
      interval: 20s
      start_period: 10s
      timeout: 10s
      retries: 3

  postfix:
    image: catatnight/postfix
    environment:
      maildomain: neontribe.co.uk
      smtp_user: kimai:kimai
    restart: unless-stopped
    restart: always

volumes:
    var:
    public:

Additional context
Commenting out the start_period parameter made docker correctly pull, build and start kimai

@urinal-cake
Copy link
Author

urinal-cake commented Jan 14, 2020

This no longer occurs if you modify the docker-compose version to 3.4
Does that mean that this docker-compose setup for kimai doesn't support 3.5?

@Schrolli91
Copy link
Collaborator

Schrolli91 commented Jan 15, 2020

https://docs.docker.com/compose/compose-file/#healthcheck

Note: start_period is only supported for v3.4 and higher of the compose file format.

maybe to old docker-compose version?
https://github.com/docker/compose/releases/tag/1.17.1

Compose file format Docker Engine
3.3 – 3.4 17.06.0+
3.0 – 3.2 1.13.0+
2.3 17.06.0+
2.2 1.13.0+
2.1 1.12.0+
2.0 1.10.0+
1.0 1.9.1+

@Schrolli91 Schrolli91 added the question Further information is requested label Jan 15, 2020
@Schrolli91 Schrolli91 added the need_info More informationens are needed label Jan 22, 2020
@tobybatch
Copy link
Owner

bump. This is a docker compose version issue. So it's a won't fix.

@tobybatch tobybatch added wontfix This will not be worked on and removed need_info More informationens are needed question Further information is requested labels Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants