Skip to content

baseイメージの /etc/devbase が0644になりシェル起動時にPermission deniedとなる #156

Description

@takemi-ohama

症状

baseイメージをno-cacheで再ビルドしてコンテナを再作成すると、bash起動時に次のエラーが出ます。

-bash: /etc/devbase/ai-cli-aliases.sh: Permission denied

再現結果

ai-plugins:latestを新しいコンテナで起動すると、親ディレクトリが次のpermissionになっていました。

drw-r--r-- 644 root:root /etc/devbase

ubuntuユーザーはディレクトリを探索できず、配下のai-cli-aliases.shをsourceできません。

根本原因

containers/base/Dockerfileが、事前に/etc/devbaseを作らずに次のCOPYを実行しています。

COPY --chmod=0644 ai-cli-aliases.sh /etc/devbase/ai-cli-aliases.sh

BuildKitが暗黙作成した親ディレクトリにも0644が適用され、必要な実行権限がありません。

修正方針

  • COPY前に/etc/devbaseを0755で明示作成する
  • Dockerfileの配線テストへディレクトリpermission要件を追加する
  • no-cacheビルドした実イメージでubuntuユーザーがファイルをsourceできることを確認する

暫定復旧

稼働中ai-plugins-dev-1では次を実行し、source成功を確認済みです。

docker exec -u root ai-plugins-dev-1 chmod 0755 /etc/devbase

由来

PR #154 のv3.2.1リリース後テストで発見しました。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions