Skip to content

docs: explain how to make build stage in docker-compose.*.yaml work offline - #7480

Merged
rfay merged 4 commits into
ddev:mainfrom
stasadev:20250723_stasadev_build_stage_offline
Aug 1, 2025
Merged

rfay merged 4 commits into
ddev:mainfrom
stasadev:20250723_stasadev_build_stage_offline

Conversation

@stasadev

@stasadev stasadev commented Jul 23, 2025 •

Copy link
Copy Markdown
Member

The Issue

When you don't have an image with build stage, your DDEV can't work offline:

How This PR Solves The Issue

Explains it.

Manual Testing Instructions

https://ddev--7480.org.readthedocs.build/en/7480/users/extend/custom-compose-files/#conventions-for-defining-additional-services

Automated Testing Overview

Release/Deployment Notes

@stasadev
stasadev requested a review from a team as a code owner July 23, 2025 17:36

```yaml
services:
someservice:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a dummy image here as well since there usually is one?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

```yaml
services:
someservice:
image: ${CUSTOM_DOCKER_IMAGE:-busybox:latest}-${DDEV_SITENAME}-built

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be <your-docker-image> as opposed to a variable?

I see why you're using a variable there (so it's in all the places) but it does seem like people might not understand.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how to place <your-docker-image> here, replaced busybox:latest with example/example:latest and CUSTOM_DOCKER_IMAGE with YOUR_DOCKER_IMAGE.

# Add a build stage so we can add `mkcert`, etc.
# Add an image and a build stage so we can add `mkcert`, etc.
# The Dockerfile for the build stage goes in the `.ddev/example directory` here
image: ${EXAMPLE_DOCKER_IMAGE:-example/example:latest}-${DDEV_SITENAME}-built

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here with EXAMPLE_DOCKER_IMAGE

@rfay
rfay merged commit 80b7336 into ddev:main Aug 1, 2025
@rfay
rfay deleted the 20250723_stasadev_build_stage_offline branch August 1, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants