iT邦幫忙

0

Docker-compose起MYSQL容器總是無限重啟...

  • 分享至 

  • xImage

version: '3.5'

services:
zabbix-mysql:
image: mysql:5.7.21
container_name: zabbix-mysql
ports:
- "3306:3306"
volumes:
- "/var/lib/docker-apps/mysql:/var/lib/mysql:Z"
restart: always
networks:
network1:
ipv4_address: 172.25.0.2
environment:
- MYSQL_DATABASE:zabbix
- MYSQL_ROOT_PASSWORD:ggininder
- MYSQL_USER:zabbix
- MYSQL_PASSWORD:ggdadader
- HOSTNAME:mysql
- TZ:Asia/Taipei
zabbix-server:
image: monitoringartist/zabbix-xxl
container_name: zabbix-server
links:
- zabbix-mysql:172.25.0.2
ports:
- "8888:80"
volumes:
- "/var/lib/docker-apps/zabbix:/usr/lib/zabbix/alertscripts:Z"
- "/var/lib/docker-apps/zabbix:/usr/lib/zabbix/externalscripts:Z"
- "/var/lib/docker-apps/zabbix:/var/lib/zabbix/modules:Z"
- "/var/lib/docker-apps/zabbix:/var/lib/zabbix/enc:Z"
- "/var/lib/docker-apps/zabbix:/var/lib/zabbix/snmptraps:Z"
- "/var/lib/docker-apps/zabbix:/var/lib/zabbix/mibs:Z"
restart: always
networks:
network1:
ipv4_address: 172.25.0.3
depends_on:
- zabbix-mysql
environment:
- DB_SERVER_HOST:mysql
- DB_SERVER_PORT:3306
- MYSQL_USER:zabbix
- MYSQL_PASSWORD:ggdadader
- TZ:Asia/Taipei
grafana:
image: grafana/grafana
container_name: grafana
ports:
- "3000:3000"
restart: always
networks:
network1:
ipv4_address: 172.25.0.4
depends_on:
- zabbix-mysql
- zabbix-server
networks:
network1:
name: zabbix-network
driver: bridge
ipam:
driver: default
config:
-
subnet: 172.25.0.0/16

麻煩各路大神幫忙看一下這個docker-compose.yml檔哪邊有設定錯誤嗎?
目前嘗試將grafana、zabbix-server全都註解掉後,MYSQL依舊無限重啟...囧
而將environment:部份全註解到僅剩TZ後還是無限重啟
正在用呂布治百病大法嘗試看看,希望有大神指教

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

0
burger43
iT邦見習生 ‧ 2018-10-11 12:03:35

會不會是這個的問題呀

links:
- zabbix-mysql:172.25.0.2

他會重複呼叫 zabbix-mysql server
造成build mysql image

我要發表回答

立即登入回答