Challenge - 5 Problems
Compose File Versioning Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Understanding Compose file version declaration
What is the purpose of specifying the
version field at the top of a Docker Compose file?Attempts:
2 left
💡 Hint
Think about how Compose files evolve and how Docker knows which syntax rules to apply.
✗ Incorrect
The
version field in a Compose file tells Docker Compose which file format version to use. This affects which features and syntax are supported in the file.💻 Command Output
intermediate2:00remaining
Output of docker-compose with unsupported version
Given this Compose file snippet, what will be the output or result when running
docker-compose up?
version: '5.0'
services:
web:
image: nginxDocker
version: '5.0'
services:
web:
image: nginxAttempts:
2 left
💡 Hint
Check which Compose file versions are officially supported by Docker Compose.
✗ Incorrect
Docker Compose does not support version 5.0. It will throw an error indicating the version is unsupported.
❓ Configuration
advanced1:30remaining
Compose file version and feature compatibility
Which Compose file version must be used to enable the
profiles feature that allows conditional service startup?Attempts:
2 left
💡 Hint
Profiles were introduced in a recent Compose file version starting with 3.x.
✗ Incorrect
The
profiles feature was introduced in Compose file version 3.9, allowing conditional service activation.❓ Troubleshoot
advanced2:00remaining
Diagnosing version mismatch issues
You have a Compose file with
version: '3.8' but when running docker-compose up, some features like secrets are not working as expected. What is the most likely cause?Attempts:
2 left
💡 Hint
Check compatibility between Docker Engine and Compose file features.
✗ Incorrect
Some Compose file features require a minimum Docker Engine version. If the engine is outdated, features like secrets won't work even if the Compose file version is correct.
✅ Best Practice
expert2:30remaining
Choosing Compose file version for multi-environment projects
For a project that needs to run on both local developer machines and a cloud CI/CD pipeline with different Docker versions, which Compose file version strategy is best to ensure maximum compatibility?
Attempts:
2 left
💡 Hint
Think about stability and compatibility across different environments.
✗ Incorrect
Using the lowest common Compose file version ensures the file works everywhere, avoiding failures due to unsupported features or versions.