devcontainers / devcontainers/features

The PHP feature has a very bad performance (in GitHub Codespaces)

Open
#672 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Shell
Stars
1.5k
Forks
621
Avg merge
2d 11h
Merged PRs (30d)
4

Description

I can use this e.g. as the image: `mcr.microsoft.com/devcontainers/php`

In GitHub Codespaces that results in _that_:
![grafik](https://github.com/devcontainers/templates/assets/11966684/745c9139-1dc5-41e5-b76b-05183ac69245)

It is slow, very slow, because – I guess – it _literally_ compiles PHP – given [it depends on the official PHP docker container](https://github.com/devcontainers/images/blob/992d14db469202201020633827c2eb8857ba3ea7/src/php/.devcontainer/Dockerfile#L3) and they famously compile Docker from scratch there.

I just wonder why nothing is cached? Afterall, it should not build for minutes and these basic images should be cached.
For "quick development", which GitHub Codespaces is aimed at, that is a no-go.

This is my full `.devcontainer` file:
```json
{
"name": "PHP",
"image": "mcr.microsoft.com/devcontainers/php",
"customizations": {
"vscode": {
"extensions": [
"github.codespaces",
"DEVSENSE.phptools-vscode",
"EditorConfig.EditorConfig",
"dbaeumer.vscode-eslint",
"raymondcamden.CSSLint",
"DEVSENSE.composer-php-vscode"
]
},
"codespaces": {
"repositories": {
"PrivateBin/*": {
"permissions": {
"pull_requests": "write"
}
}
}
}
},
"forwardPorts": [
8080
],
"features": {
"ghcr.io/devcontainers/features/php:1": {
"installComposer": true,
"version": "latest"
}
},
"postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html",
"postStartCommand": "apache2ctl start"
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.