Docker Compose File Support - VS Code Extension

Enhanced support for Docker Compose files in VS Code with syntax highlighting, formatting, and validation.
Features
Syntax Highlighting
- Special highlighting for Docker Compose specific keywords
- Different colors for services, volumes, networks sections
- Highlighting for common service properties
- Automatically organizes your docker-compose file structure
- Sorts services alphabetically
- Standardizes indentation (2 spaces)
- Reorders properties logically (image before build, etc.)
Validation
- Validates YAML syntax
- Warns about common mistakes
Installation
- Open VS Code
- Go to Extensions view (
Ctrl+Shift+X
)
- Search for "Docker Compose Support"
- Click Install
Alternatively, install from VS Code Marketplace:
Install Docker Compose Support
Usage
To format a Docker Compose file:
- Open your
docker-compose.yml
file
- Use the command palette (
Ctrl+Shift+P
)
- Run "Format Document" command
- Select "Docker Compose File Support" as the formatter
Keyboard Shortcut: Shift+Alt+F
Configuration
Add these settings to your VS Code preferences (settings.json
) to customize:
{
"[docker-compose]": {
"editor.defaultFormatter": "KilianJPopp.docker-compose-support",
"editor.formatOnSave": true
},
"docker-compose.format.enabled": true
}
Supported Files
docker-compose.yml
docker-compose.yaml
*.compose.yml
*.compose.yaml
Requirements
Extension Settings
This extension contributes the following settings:
Setting |
Description |
Default |
docker-compose.format.enabled |
Enable/disable formatting |
true |
docker-compose.validation.enabled |
Enable/disable validation |
true |
Known Issues
- Limited support for Compose specification v3.8+ features
Release Notes
1.0.0
Initial release with:
- Basic syntax highlighting
- Document formatting
- Simple validation
Contributing
Contributions are welcome! Please open issues or pull requests at:
https://github.com/your-username/docker-compose-support
License
BSD-3-Clause-Clear