Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Validating docker-compose yml file

Is there any easy way to verify the syntax, etc of a docker-compose file (docker-compose.yml aka fig.yml) without having to run docker proper?

I am trying to add a quick check to my build / test pipeline to verify my compose files.

like image 207
Alex Rothberg Avatar asked Mar 24 '15 06:03

Alex Rothberg


People also ask

How do I run a docker compose yml file?

To run and open . yml files you have to install Docker Compose. After the installation, go to your docker-compose. yml directory and then execute docker-compose up to create and start services in your docker-compose.

Where is the Docker compose yml file?

The Compose file is a YAML file defining services, networks and volumes. The default path for a Compose file is ./docker-compose.yml .


Video Answer


1 Answers

Meanwhile this has been added to docker-compose as docker-compose config. Validating your file now is as simple as docker-compose -f docker-compose.yml config. As always, you can omit the -f docker-compose.yml part when running this in the same folder as the file itself or having the COMPOSE_FILE environment variable pointing to your file.

like image 119
Dirk Avatar answered Sep 19 '22 14:09

Dirk