Dockerfile の版指定を Dependabot が追える形に揃える - #16
Merged
Conversation
COPY --from=<イメージ> は Dependabot の解析対象外。docker エコシステムの パーサは FROM 行だけを拾っているため、この書き方では uv の版がいつまでも 更新されないまま置き去りになる。 FROM でステージにして COPY --from=uv で参照する形に変え、あわせて現在の 最新 0.12.5 に上げた。取得元と版が変わるだけでビルドの内容は変わらない。 CALIL org 全体の同じ書き方をまとめて直している。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ncFLgwDauCWBCZ3XQWeVR
python:3.14-slim のようなマイナー止まりのタグは中身が可変で、同じ Dockerfile でもビルドのたびに別のパッチ版が入る。Dependabot も 3.15 が 出るまで PR を出さないので、更新されたことが記録に残らない。 CALIL org の他リポジトリはパッチ版まで固定しているものが多数派なので、 それに合わせる(3.14 系の現在の最新は 3.14.7)。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ncFLgwDauCWBCZ3XQWeVR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
COPY --from=ghcr.io/astral-sh/uv:<タグ>は Dependabot の解析対象外。docker エコシステムのパーサはFROM行だけを正規表現で拾っているため(dependabot-core のdocker/lib/dependabot/shared/shared_file_parser.rbのFROM_LINE)、この書き方では uv の版がいつまでも更新されない。変更
uv を
FROMでステージとして持ち込み、COPY --from=uvで参照する形にした。これで docker エコシステムの更新対象になる。あわせて版を 0.12.5(現在の最新)に上げた。取得元と版が変わるだけで、ビルドの内容は変わらない。
横展開
CALIL org 全体で同じ書き方を使っているリポジトリをまとめて直している(active で13リポジトリ・15ファイル。うち7リポジトリは
:latestで版すら固定されていなかった)。すでに
FROM ghcr.io/astral-sh/uv:<版> AS uvの形になっている negima-bib と openbs-api がこの書き方の先例。🤖 Generated with Claude Code
https://claude.ai/code/session_015ncFLgwDauCWBCZ3XQWeVR
追記: python のパッチ版固定
python:3.14-slimのようなマイナー止まりのタグは中身が可変で、同じ Dockerfile でもビルドのたびに別のパッチ版が入る。Dependabot も 3.15 が出るまで PR を出さないので、更新されたことが記録に残らない。CALIL org の他リポジトリはパッチ版まで固定しているものが多数派なので、それに合わせて 3.14.7 にした。