Reputation: 2202
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
Upvotes: 1
Views: 54
Reputation: 2202
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"
Upvotes: 0
Reputation: 158847
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.
Upvotes: 3