1. What happened?
ha-test-unified-alerting setup did come up
2. What did you expect to happen?
I expected the docker-compose up to bring up all the containers
3. How to reproduce it?
a. Clone the latest grafana repo (main branch)
b.
cd <grafana repo>
make build-docker-full
c. docker-compose up -d
- this throws following error
ERROR: The Compose file './docker-compose.yaml' is invalid because:
Unsupported config option for services.db: 'platform'
Docker-compose version
docker-compose version 1.25.0, build unknown
Docker Engine version
Client: Docker Engine - Community
Version: 24.0.7
can you share the compose file?
version: "2.1"
services:
db:
image: mysql:8.0.32
platform: linux/x86_64
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: grafana
MYSQL_USER: grafana
MYSQL_PASSWORD: password
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --innodb_monitor_enable=all, --max-connections=1001]
ports:
- 3306
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 10s
retries: 10
mysqld-exporter:
image: prom/mysqld-exporter
environment:
- DATA_SOURCE_NAME=root:rootpass@(db:3306)/
ports:
- 9104
depends_on:
db:
condition: service_healthy
prometheus:
image: prom/prometheus:v2.4.2
volumes:
- ./prometheus/:/etc/prometheus/
environment:
- VIRTUAL_HOST=prometheus.loc
ports:
- 9090
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
depends_on:
db:
condition: service_healthy
grafana1:
extends:
file: ./grafana-service.yml
service: grafana
ports:
- 3010:3000
depends_on:
db:
condition: service_healthy
grafana2:
extends:
file: ./grafana-service.yml
service: grafana
ports:
- 3020:3000
depends_on:
db:
condition: service_healthy
grafana1:
condition: service_healthy
grafana3:
extends:
file: ./grafana-service.yml
service: grafana
ports:
- 3030:3000
depends_on:
db:
condition: service_healthy
grafana2:
condition: service_healthy
grafana4:
extends:
file: ./grafana-service.yml
service: grafana
ports:
- 3040:3000
depends_on:
db:
condition: service_healthy
grafana3:
condition: service_healthy
webhook:
image: webhook-receiver
build:
context: .
dockerfile: Dockerfile
ports:
- "18081:8080"
volumes:
- "./logs/webhook:/tmp/logs:rw"
I also tried with docker compose up
(version > 2)
but it throws this error
ha-test-unified-alerting-nginx-proxy-1 | dockergen.1 | 2024/01/09 06:26:50 Generated '/etc/nginx/conf.d/default.conf' from 5 containers
ha-test-unified-alerting-nginx-proxy-1 | dockergen.1 | 2024/01/09 06:26:50 Running 'nginx -s reload'
ha-test-unified-alerting-nginx-proxy-1 | dockergen.1 | 2024/01/09 06:26:50 Received event die for container 846715cda8f0
dependency failed to start: container ha-test-unified-alerting-grafana1-1 exited (1)
can you try changing your ports sections from:
to
everywhere you have a single port, and enclose these - 3040:3000 like this - “3040:3000”
and then try run the docker-compose again
version: "2.1"
services:
db:
image: mysql:8.0.32
platform: linux/x86_64
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: grafana
MYSQL_USER: grafana
MYSQL_PASSWORD: password
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --innodb_monitor_enable=all, --max-connections=1001]
ports:
- "3306:3306"
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 10s
retries: 10
mysqld-exporter:
image: prom/mysqld-exporter
environment:
- DATA_SOURCE_NAME=root:rootpass@(db:3306)/
ports:
- "9104:9104"
depends_on:
db:
condition: service_healthy
prometheus:
image: prom/prometheus:v2.4.2
volumes:
- ./prometheus/:/etc/prometheus/
environment:
- VIRTUAL_HOST=prometheus.loc
ports:
- "9090:9090"
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
depends_on:
db:
condition: service_healthy
grafana1:
extends:
file: ./grafana-service.yml
service: grafana
ports:
- "3010:3000"
depends_on:
db:
condition: service_healthy
grafana2:
extends:
file: ./grafana-service.yml
service: grafana
ports:
- "3020:3000"
depends_on:
db:
condition: service_healthy
grafana1:
condition: service_healthy
grafana3:
extends:
file: ./grafana-service.yml
service: grafana
ports:
- "3030:3000"
depends_on:
db:
condition: service_healthy
grafana2:
condition: service_healthy
grafana4:
extends:
file: ./grafana-service.yml
service: grafana
ports:
- "3040:3000"
depends_on:
db:
condition: service_healthy
grafana3:
condition: service_healthy
webhook:
image: webhook-receiver
build:
context: .
dockerfile: Dockerfile
ports:
- "18081:8080"
volumes:
- "./logs/webhook:/tmp/logs:rw"
Same error both with docker-compose up -d and sudo docker compose up
can you try the config verification:
docker-compose config --quiet && printf “OK\n” || printf “ERROR\n”
ERROR: The Compose file './docker-compose.yaml' is invalid because:
Unsupported config option for services.db: 'platform'
“ERRORn”
can you try removing this section:
platform: linux/x86_64