Skip to content
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 build処理の高速化と生成されるイメージファイルの軽量化. #4333

Merged
merged 1 commit into from
Oct 1, 2019
Merged

docker build処理の高速化と生成されるイメージファイルの軽量化. #4333

merged 1 commit into from
Oct 1, 2019

Conversation

genzouw
Copy link
Contributor

@genzouw genzouw commented Sep 26, 2019

概要(Overview・Refs Issue)

docker build処理の高速化と生成されるイメージファイルの軽量化.

方針(Policy)

  1. 処理時間短縮
  2. イメージサイズ削減

実装に関する補足(Appendix)

処理時間 イメージサイズ
改善前 5:01.91 926MB
改善後 3:29.11 743MB

1. 改善前-ログ

$ docker build --no-cache -t eccube4-php-apache .
...
docker build --no-cache -t eccube4-php-apache .  2.26s user 1.74s system 1% cpu 5:01.91 total

$ docker images | grep eccube4
eccube4-php-apache                                                     latest                 c454f78a8907        4 seconds ago       926MB

2. 改善後-ログ

$ docker build --no-cache -t eccube4-php-apache .
...
docker build --no-cache -t eccube4-php-apache .  2.17s user 1.65s system 1% cpu 3:29.11 total

$ docker images | grep eccube4
eccube4-php-apache                                                     latest                 78d53e5871e4        8 seconds ago       743MB

テスト(Test)

ローカルPCで実行。

相談(Discussion)

初めてのプルリクエストなので不安がいっぱいです。
不備などあれば直ちに対応しますのでご連絡ください。

マイナーバージョン互換性保持のための制限事項チェックリスト

  • 既存機能の仕様変更
  • フックポイントの呼び出しタイミングの変更
  • フックポイントのパラメータの削除・データ型の変更
  • twigファイルに渡しているパラメータの削除・データ型の変更
  • Serviceクラスの公開関数の、引数の削除・データ型の変更
  • 入出力ファイル(CSVなど)のフォーマット変更

レビュワー確認項目

  • 動作確認
  • コードレビュー
  • E2E/Unit テスト確認(テストの追加・変更が必要かどうか)
  • 互換性が保持されているか
  • セキュリティ上の問題がないか

@nanasess
Copy link
Contributor

一旦 /tmp で composer install してから移動させた方が、2回目以降キャッシュが効いて速くなりそうですが、いかがでしょうか。
https://github.com/EC-CUBE/ec-cube/pull/4333/files#diff-3254677a7917c6c01f55212f86c57fbfL50

参考)
https://blog.hanhans.net/2017/02/25/docker-cache-composer-install/

@genzouw
Copy link
Contributor Author

genzouw commented Sep 26, 2019

@nanasess CI/CDで回すことを考えたり、あるいは新規ユーザにフォーカスした場合、1回目が早いほうがメリットが大きいと僕は思いました。
また、何度も docker build することは少ないだろうと思っています。

@chihiro-adachi chihiro-adachi added the improvement 機能改善 label Sep 27, 2019
@chihiro-adachi chihiro-adachi added this to the 4.0.4 milestone Sep 27, 2019
@kazumiiiiiiiiiii kazumiiiiiiiiiii merged commit 6d2c3f8 into EC-CUBE:4.0 Oct 1, 2019
@kazumiiiiiiiiiii
Copy link
Contributor

@genzouw ありがとうございます!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement 機能改善
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants