Skip to content

Create Devcontainer config#4793

Merged
jordikroon merged 25 commits into
php:masterfrom
garrettw:master
Jun 15, 2026
Merged

Create Devcontainer config#4793
jordikroon merged 25 commits into
php:masterfrom
garrettw:master

Conversation

@garrettw

@garrettw garrettw commented Jul 27, 2025

Copy link
Copy Markdown
Contributor

As requested by @TimWolla.

@TimWolla TimWolla self-requested a review July 27, 2025 18:25
@garrettw

Copy link
Copy Markdown
Contributor Author

@TimWolla it's all ready for you now

@Girgias

Girgias commented Aug 1, 2025

Copy link
Copy Markdown
Member

I don't know anything about containerization and don't have any strong opinions about this.

@TimWolla

Copy link
Copy Markdown
Member

Thank you. I've tried spawning a codespace from your repository, connected to it via VS Code and ran make php. It failed with:

if [ -n "devcontainer" ] && [ "devcontainer" = "devcontainer" ]; then \
        .devcontainer/configure-apache.sh "/workspaces/php-doc-en/output/php-web"; \
fi
Apache web root directory set to /workspaces/php-doc-en/output/php-web
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
make: *** [Makefile:29: php] Error 1

It appears the post-create.sh was not properly executed? Do you have any idea of what I did wrong?

Also, I think it would be nice to avoid the additional layer of Docker within a Codespace / dev container. Would it perhaps work to directly install Java + PHP in the Codespace at creation time?

@garrettw

Copy link
Copy Markdown
Contributor Author

I'm sure I can find a way to avoid the extra Docker layer. No idea on the other problem though - it's not happening on my end with a fresh Codespace.

@cweiske

cweiske commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Do I see correctly that devcontainer.json is specific to Visual Studio Code and no other IDEs?

Why is a devcontainer with a web server needed at all, when the Makefile already uses a container to build/render the manual?

@garrettw

garrettw commented Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

@cweiske The Devcontainer spec is not specific to VS Code, though it was probably implemented there first as it's a Microsoft invention. PhpStorm supports it as well, but more importantly, GitHub Codespaces can use it to spawn a pre-customized browser-based dev environment based on VS Code.

Sorry I've let this languish; life priorities got in the way and it slipped my mind.

Comment thread .devcontainer/devcontainer.json Outdated
The symbolic link creation for doc-base's language source directory is no longer needed and has been removed from the post-create initialization script.
@jordikroon

Copy link
Copy Markdown
Member

Thank you for proposing this idea @garrettw, and I am sorry this went stale for so long.

I support this, in fact Is support any initiative that helps newcomers to get started more easily. And I believe this solutions also everyone to more quickly peek at new changes that are packed in a PR.

It took me a while (as seen above) to feel satisfied with the setup. The original setup was using docker-in-docker, which didn't feel right to me as all the tools should already be available in devcontainer.

The new setup is using PHP built-in webserver directly, built on Trixie which is the latest version of Debian. And does have PHP 8.4 included. Launch scripts are available to quickly build without the need to really understand the build process. Similar to how make helps for docker users.

After getting an initial version working, I noticed it was.. slow. Which is why I got side tracked to fix php/doc-base#300. Which not only improved the dev container, but also give a huge improvement to using regular builds.

@jordikroon jordikroon requested a review from TimWolla June 15, 2026 17:07

@TimWolla TimWolla left a comment

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.

Did a superficial review, but didn't see any obvious issues. Given the number of commits, I trust that you tested this. Thank you!

@jordikroon jordikroon merged commit a645095 into php:master Jun 15, 2026
@garrettw

Copy link
Copy Markdown
Contributor Author

@jordikroon Awesome! Thank you so much for picking up the torch and getting this over the finish line!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants