Docker Swarm 自定义配置

版本

Docker 版本大等于

Compose file format Docker Engine release
3.3 17.06.0+

用法示例

version: '3.3'

services:

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.2.3
    environment:
      - "ES_JAVA_OPTS=-Xms100m -Xmx100m"
    ports:
      - 9200:9200
      - 9300:9300
    configs:
      - source: my_config
        target: /usr/share/elasticsearch/config/elasticsearch.yml


  kibana:
    image: docker.elastic.co/kibana/kibana:6.2.3
    environment:
      - "ELASTICSEARCH_URL=http://101.132.47.70:9200"
    ports:
      - 5601:5601


configs:
  my_config:
    file: $PWD/my_config.yml

官方参考文档

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

你可能感兴趣的:(docker,docker,swarm,docker,compose,configs,elasticsearch)