fix: remove docker info check from container runtime detection#829
Merged
jesseturner21 merged 1 commit intomainfrom Apr 14, 2026
Merged
fix: remove docker info check from container runtime detection#829jesseturner21 merged 1 commit intomainfrom
jesseturner21 merged 1 commit intomainfrom
Conversation
detectContainerRuntime() called `docker info` to verify the daemon was running. This requires access to the Docker socket and triggers an OS password prompt on machines where the user is not in the docker group. The check provided no real value: deploy falls back to CodeBuild anyway, and dev will fail with a clear error from `docker build` if the daemon is down. Remove the `docker info` probe and rely on `which` + `--version` only, matching the approach already used by detectContainerRuntimeSync(). Also removes the now-unused START_HINTS constant, getStartHint() helper, and notReadyRuntimes tracking.
Contributor
Package TarballHow to installnpm install https://github.com/aws/agentcore-cli/releases/download/pr-829-tarball/aws-agentcore-0.8.0.tgz |
Contributor
Coverage Report
|
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.
Problem
During
agentcore deploy, the "Check dependencies" preflight callsdetectContainerRuntime()which runsdocker info. This command communicates with the Docker daemon through the Unix socket (/var/run/docker.sock). If the user isn't in thedockergroup, the OS prompts for a password — a confusing experience since the container runtime check is non-blocking (deploy falls back to CodeBuild for container builds anyway).The same issue affects
agentcore devwith Container agents and users of Colima (which uses the standarddockerCLI binary).Options considered
Remove
docker infoentirely — detect runtimes withwhich+--versiononly. If the daemon isn't running, the user finds out when they actually use it (docker buildfails with a clear "Cannot connect to the Docker daemon" error).Keep
docker infobut suppress the password prompt — not possible. The OS-level polkit/sudo prompt fires before our code can react to the result.Keep
docker infobut catch the failure silently — same problem: the prompt appears before the command returns a result. We can't prevent it.Solution
Option 1. Remove the
docker infocall fromdetectContainerRuntime()and rely onwhich+--versionfor binary detection. This matches the approach already used bydetectContainerRuntimeSync()insrc/lib/packaging/container.ts.The tradeoff is losing the proactive "start Docker" hint when the daemon is down. But the
docker builderror message is clear enough, and avoiding a surprise password prompt is worth that tradeoff.Changes
docker infoprobe fromdetectContainerRuntime()notReadyRuntimestracking (only populated by thedocker infofailure path)getStartHint()helper andSTART_HINTSconstant (only used to formatnotReadyRuntimesmessages)requireContainerRuntime()to just throw "not found" if no runtime passeswhich+--versioncontainer-dev-server.tsprepare() to just check ifruntimeis nullTest plan
detectContainerRuntime()returns Docker info viawhich+--versiononly (no password prompt)agentcore dev -lwith Container agent — full flow completes (build, start, run) with no password promptagentcore deploywith Container agent on a machine without docker group membership — verify no password prompt