docker container 和主机时间同步

linux 下:
docker-compose.yml配置文件:

version: '3.7'
services:
 web:
    image: username/tag
    volumes:
      - type: bind
        source: /etc/localtime
        target: /etc/localtime

version要大于等于3.7,volumes选项才支持type方式

你可能感兴趣的:(docker container 和主机时间同步)