Formats docker-compose files by using the distilled docker compose best practices.
Docker Compose Files are complex
Docker Compose Files could be rather complex.
If these files are complex, there are multiple ways to write the same thing.
If there are multiple ways to format these files, these multiple ways will be used.
Means that it will be not possible to diff your files, cause everybody writes them a bit different.
Alphabetical order vs. custom order
Sorting would be easy, if everything could be sorted alphabetically.
But in compose files the first thing mentioned for a service is the
compose_format aims to distill these compose format best practices into a tool.
Usually formatting tools destroy comments. But comments contain valueable TODO-markers or other hints.
compose_format putted effort into supporting comments.
Note that this small utility is just valid until docker-compose has itself a format functionality.
Currently docker-compose just support the "config" switch. Which joins multiple compose files and print them in a machine-readable form.
Install it via:
pip3 install compose_format
After that use it like
this will print the formatted compose file to stdout.
To let it replace the compose file add
Use it like:
cat docker-compose.yml | docker run -i funkwerk/compose_format
- Support for Version 3, 2.1, 2, and 1.
- Support for Comments
- Orders Services, Volumes, Networks
- Orders Definitions
- Orders Port and Volume Lists
Feel free to add issues or provide Pull Requests.
Especially when the order in some points violates the best practices.
This tool should be changed based on the evolving best practices.
Template Blog Seo Friendly
Cara MenggantiTemplate Blog
Marimas Bikin Adem, Tidak Bikin Batuk
Jobsmart.co.id : Situs Informasi Lowongan Kerja Terbaru di Indonesia
Cara Membuat Blog Gratis
Daftar Kontes Seo Terbaru 2017
Cara Mengganti dan Menginstall Template WordPress
Cara Membuat Posting Artikel Pertama di Blog WordPress
Cara Setting Website Gratis di WordPress
cara membuat website gratis diWordPress