Closed gosaaan1 closed 1 year ago
うまく動作しているコンテナの Inspect。
現象が起こっているコンテナの Inspect。waylandのバインドマウントされているのが原因?
…煮詰まってきたので、いったん現状整理。
apt update && apt install -y gnupg pass
した直後は現象が起こらない。コンテナが一度でも停止すると現象が起こる。 ★必要なプロセスが落ちてない?gpg --gen-key --verbose
とやっても有益な情報が得られないので不明。gpg-agent
を打つと、プロセスは生きているので、それ以外?
VSCode Remote Containers を使って開発する場合、Dockerfile を書いて「Reopen in Container」とすると Docker コンテナが起動しますが、この時 VSCode が docker run を実行します。 このため、何も気にせず公式の手順などを参考に起動すれば、--privileged オプションを付加できず、ENTRYPOINT に /sbin/init も渡せないため、コンテナで systemctl を実行できません。
--privileged
オプションはdevcontainer.json
で"runArgs": ["--privileged"]
を追加すればよい。
/sbin/init
がうまく動かない。
[8584 ms] postCreateCommand failed with exit code 1. Skipping any further user-provided commands. [8585 ms] Error: Command failed: /bin/sh -c /sbin/init
https://github.com/gosaaan1/hokulea-garage/issues/3#issuecomment-1465057782 このチェックを外すとソケットバインドされなくなるが、現象は変わらず。 Dev Containers拡張機能>チュートリアル
回避方法が見つかったので、メモ。
devcontainer.json
に以下の細工をして、ローカル側にフォワーディングできないようにすれば、V1.75以降でも同じ動作ができるようになる。{
"image": "terraform-mfa:22.202303",
"postCreateCommand": "rm ~/.gnupg/S.gpg-agent* && gpg-connect-agent reloadagent /bye",
"extensions": [
"eamodio.gitlens",
"hashicorp.terraform"
]
}