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

Update dockerfile #59

Closed
wants to merge 5 commits into from
Closed

Update dockerfile #59

wants to merge 5 commits into from

Conversation

masnagam
Copy link
Contributor

Dockerfileが機能していなかったので修正しました.

テスト用にdocker-compose.ymlを追加しました.version: '3'としていますが,vesion: '2'でも多分動きます.書き換えたほうが良いなら指摘をお願いします.

build stage image: 999MB -> 243MB
build stage image: 243MB -> 171MB
final image      : 226MB -> 154MB
This makes it possible to detect installation issues due to a lack of
required files before publishing the NPM package.

The NPM package contains only required files.  So, the final image
size can be reduced from 154MB to 99.6BM.
build stage image: 171MB -> 0
final image      : 99.6MB -> 99.9MB
docker-compose.yml has been added for testing purpose.  A data volume
which mounted at /usr/local/var/db/mirakurun is created automatically
when running `docker-compose up`.  Use `docker-compose down` with the
`-v` option if you want to remove the data volume at the shutdown.  Or
remove it manually using `docker voluem rm`.
@masnagam
Copy link
Contributor Author

rebaseして再修正しました.

不要な修正をrevertしやすいように段階的にコミットしました.

個人的な意見ですが,マルチステージを使用しなくてもいいのではないかと思っています.

  • docker build --target build -t ...としないと中間イメージにはタグがつかない
    • docker-compose buildではタグがつかない
    • docker images -f dangling=true -q | xargs docker rmiすると消えてしまう
  • ビルドのためにapt/apkなどで追加しないといけないパッケージがない
    • ビルドだけで使う追加パッケージのせいで,最終イメージのサイズが増えるということがない
  • 問題になるほどRUNの行数が多くない

@kanreisa
Copy link
Member

PR の作成、ありがとうございます。
とりあえず現状でよいかと思うので Close させていただきます。

  • 不完全な状態の docker-compose.yml は追加したくありません
  • 他のプロジェクトで node-alpine を使っていて問題が発生してしまったのと、本プロジェクトでは主に Debian 系を開発環境としていますのでとりあえず今回を期に node-slim に切り替えさせてください
  • テストの実装を進める予定でいますので、ひとまずそんなかんじで。これは今後にわたる決定事項ではありません。

@kanreisa kanreisa closed this May 13, 2019
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.

None yet

2 participants