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.
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.
The Compose file is a YAML file defining services, networks and volumes. The default path for a Compose file is ./docker-compose.yml .
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With