-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker-php-ext-install に -j$(nproc)
を付与してパラレルビルドする
#984
docker-php-ext-install に -j$(nproc)
を付与してパラレルビルドする
#984
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #984 +/- ##
=======================================
Coverage 55.63% 55.63%
=======================================
Files 75 75
Lines 8917 8917
=======================================
Hits 4961 4961
Misses 3956 3956
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
手元環境 (WSL2) で、9秒くらい早くなりました。
適用前
$ time docker build -f Dockerfile-local -t local/ec-cube/ec-cube2-php:${TAG} --pull --build-arg TAG=${TAG} --build-arg XDEBUG
=${XDEBUG} --no-cache .
[+] Building 42.3s (10/10) FINISHED docker:default
=> [internal] load build definition from Dockerfile-local 0.0s
=> => transferring dockerfile: 333B 0.0s
=> [internal] load metadata for ghcr.io/ec-cube/ec-cube2-php:8.1-apache 0.5s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> CACHED [1/6] FROM ghcr.io/ec-cube/ec-cube2-php:8.1-apache@sha256:176444d024095f91625961eecac5fec6a1d086419cde27227e16626d5de2a9d6 0.0s
=> [2/6] RUN apt update 5.8s
=> [3/6] RUN apt -y install inetutils-ping telnet 2.4s
=> [4/6] RUN pecl install xdebug 27.7s
=> [5/6] RUN docker-php-ext-enable xdebug 0.7s
=> [6/6] RUN apt -y install iproute2 4.3s
=> exporting to image 0.4s
=> => exporting layers 0.3s
=> => writing image sha256:990b87c7cbff837da60ea5f86c0922557dc2e81fed9d0582ac05bc2801440b48 0.0s
=> => naming to docker.io/local/ec-cube/ec-cube2-php:8.1-apache 0.0s
real 0m42.840s
user 0m0.291s
sys 0m0.269s
適用後
$ time docker build -f Dockerfile-local -t local/ec-cube/ec-cube2-php:${TAG} --pull --build-arg TAG=${TAG} --build-arg XDEBUG
=${XDEBUG} --no-cache .
[+] Building 33.6s (10/10) FINISHED docker:default
=> [internal] load build definition from Dockerfile-local 0.0s
=> => transferring dockerfile: 333B 0.0s
=> [internal] load metadata for ghcr.io/ec-cube/ec-cube2-php:8.1-apache 0.7s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> CACHED [1/6] FROM ghcr.io/ec-cube/ec-cube2-php:8.1-apache@sha256:176444d024095f91625961eecac5fec6a1d086419cde27227e16626d5de2a9d6 0.0s
=> [2/6] RUN apt update 5.6s
=> [3/6] RUN apt -y install inetutils-ping telnet 2.2s
=> [4/6] RUN pecl install xdebug 19.5s
=> [5/6] RUN docker-php-ext-enable xdebug 0.6s
=> [6/6] RUN apt -y install iproute2 4.2s
=> exporting to image 0.4s
=> => exporting layers 0.3s
=> => writing image sha256:ee75d66540633d855bdfa1cf3e2ad9aac10ce43bce33143c013cec06e80a11e0 0.0s
=> => naming to docker.io/local/ec-cube/ec-cube2-php:8.1-apache 0.0s
real 0m33.866s
user 0m0.187s
sys 0m0.200s
https://localhost:4430/ 普通に表示されることを確認。
see https://github.com/docker-library/docs/tree/master/php#php-core-extensions
手元の環境では50%程度高速化した