'How do I debug a failing additional Dockerfile?

I have created .ddev/web-build/Dockerfile. It builds, but it doesn't do what I want. How do I figure out why? DRUD_DEBUG=1 ddev start doesn't show any additional output. I don't know the proper docker-compose command to try building it manually either. This does not work:

cd .ddev
docker-compose build web

because it needs specific environment variables that DDEV injects.



Solution 1:[1]

On current versions of ddev (v1.18+) you can

cd .ddev
~/.ddev/bin/docker-compose -f .ddev-docker-compose-full.yaml build web --no-cache

and you'll see the full build go by. You can use additional build arguments as well to change the output format, etc. For example, ~/.ddev/bin/docker-compose -f .ddev-docker-compose-full.yaml build web --no-cache --progress=plain

You can review the entire Dockerfile that's being built at .ddev/.webimageBuild/Dockerfile.

See docs.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1