docker-compose dry run
Problem
Would like insight to what docker-compose generates/executes
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Enable Docker Compose Dry Run with Config Validation
Docker Compose does not have a built-in dry run feature that shows what commands will be executed. However, you can use the 'config' command to validate and view the final configuration that Docker Compose will use to create containers. This allows you to see the generated configuration without actually starting the containers.
Awaiting Verification
Be the first to verify this fix
- 1
Run Docker Compose Config Command
Use the 'docker-compose config' command to output the final configuration that Docker Compose will use. This will show you the merged configuration from your docker-compose.yml file and any overrides.
bashdocker-compose config - 2
Check for Errors in Configuration
After running the config command, check the output for any errors or warnings that might indicate issues with your configuration.
- 3
Use 'docker-compose up --dry-run' Alternative
While Docker Compose does not support a direct dry run option, you can simulate a dry run by using 'docker-compose up --no-start'. This will create the containers without starting them, allowing you to verify the setup.
bashdocker-compose up --no-start - 4
Inspect the Created Containers
After running the previous command, use 'docker ps -a' to list all containers, including those that were created but not started. You can inspect these containers to ensure they are configured as expected.
bashdocker ps -a
Validation
To confirm the fix worked, ensure that the output from 'docker-compose config' matches your expectations and that the containers created with 'docker-compose up --no-start' are configured correctly without any errors.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep