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
2
Answers
There are three major versions of the
docker-compose.yml
file itself. You typically want the latest oneVersion 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:
orservices:
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.