我的compose配置,不论我是net模式还是bridge模式都存在这个问题。
version: '3'
# networks:
# xxl-job:
# driver: bridge
services:
xxl-job:
#image: docker.io/xuxueli/xxl-job-admin:2.2.0
image: xxl-job-admin:2.2.0
container_name: xxl-job-admin
restart: always
network_mode: "host"
environment:
TZ: Asia/Shanghai
PARAMS: '--spring.datasource.url=jdbc:mysql://192.168.1.109:3306/xxl_job?Unicode=true&characterEncoding=UTF-8 --spring.datasource.username=root --spring.datasource.password=123456 --xxl.job.login.username=admin --xxl.job.login.password=123456'
volumes:
# 注意同步时间
# echo 'Asia/Shanghai' > /etc/timezone/timezone
- /etc/timezone/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
- ./xxljob/applogs:/data/applogs
#ports:
# - 8080:8080
#networks:
# - xxl-job
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
2条答案
按热度按时间i2byvkas1#
environment 标签是不是格式有问题。
https://docs.docker.com/compose/environment-variables/
k10s72fa2#
environment 标签是不是格式有问题。
https://docs.docker.com/compose/environment-variables/
两种方式都可以,一个是带杠后面是等号,一个是不带杠后面是冒号