devcontainers / devcontainers/features

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

Đang mở
#672 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Shell
Star
1.5k
Fork
622
Merge trung bình
6 ngày 53 phút
Pull request đã merge (30 ngày)
9

Mô tả

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"
}
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Tái hiện sự cố bằng cấu hình .devcontainer được cung cấp và image mcr.microsoft.com/devcontainers/php. So sánh quá trình cài đặt PHP feature với Dockerfile devcontainers/images được liên kết, tập trung vào lý do các tác vụ liên quan đến PHP bị build lại thay vì được lấy từ cache. Hoàn tất khi đã xác định được nguyên nhân và thiết lập Codespaces không còn mất vài phút mới có thể sử dụng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
docker, github, php
Lĩnh vực
cloud, devops, performance
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.