简体   繁体   中英

Docker Composer File Configuration

version: "1.0"
services:
    es:
        image: "elasticsearch:7.6.1"
        container_name: myelasticsearch
        ports:
            - "9200:9200"
            - "9300:9300"
        environment:
            - discovery.type=single-node
    re:
        image: redis
        container_name: myredis
        ports:
            - "6379:6379"
    rab:
        image: "rabbitmq:3-management"  
        container_name: myrabbitmq
        ports:
            - "15672:15672"
            - "5672:5672"

when i run docker-composer up it shows ERROR: Version "1.0" in ".\\docker-compose.yml" is invalid. I am not finding why this error

There are three major versions of the docker-compose.yml file itself . You typically want the latest one

version: '3.7'

Version 1 was significant different from its successors: it put all of the service definitions at the top level, and didn't support top-level version: or services: keys. There are a number of other changes as well; if you need custom network configuration, Swarm support, or to specify the image name of a locally-built image, version 1 doesn't have any of these things.

version: "3.7"
services:
    es:
        image: "elasticsearch:7.6.1"
        container_name: myelasticsearch
        ports:
            - "9200:9200"
            - "9300:9300"
        environment:
            - discovery.type=single-node
    re:
        image: redis
        container_name: myredis
        ports:
            - "6379:6379"
    rabbitmq:
        image: "rabbitmq:3-management"  
        container_name: myrabbitmq
        ports:
            - "15672:15672"
            - "5672:5672"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM