You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c7c66e2
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(lifecycle): run hooks via the Docker exec API (drop docker exec shell-out)
The lifecycle shell server no longer shells out to `docker exec`. It runs each
command as an independent `/bin/sh -c` exec through the moby client exec API,
added as EngineClient.ExecInContainer (ExecCreate → ExecAttach → stdcopy demux →
ExecInspect for the exit code). The DockerAPI interface gains ExecCreate/
ExecAttach/ExecInspect; the mock and a focused unit test (stdcopy framing) cover it.
This drops the hand-rolled EOT framing protocol and the persistent-shell
management from internal/lifecycle/shell.go. It is behavior-preserving: no
lifecycle hook or userEnvProbe command depends on shell state carried across
commands (each probe runs its own login/interactive shell; hooks are
independent), so one-exec-per-command is equivalent while providing user/env per
exec natively. NewShellServer now takes (ctx, ContainerExecutor) instead of a
docker path; all nine call sites pass the engine client.
Validated: 35 run-user-commands + exec runtime parity cases match against the TS
oracle (lifecycle hooks, userEnvProbe, secrets, dotfiles, subfolder config).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments