docker / docker/buildx

No way to disable Context builders

Open
#1,995 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement
Dominant language
Go
Stars
4.5k
Forks
682
Avg merge
2d 14h
Merged PRs (30d)
29

Description

Description

In order to maintain a builder instance for every Docker Context, buildx seems to continually try to connect to remote contexts. This isn’t a behaviour I want and doesn’t seem to be something I can turn off. When creating a context, my intention was to use it as a better-supported alternative to exporting DOCKER_HOST when temporarily connecting to another machine, not to set up anything long-running.

As-is, there are three issues this causes

  • Docker is continually making SSH connections to external systems, including attempting to connect to production systems, without user input
  • In doing this it tries to pull private keys from an agent over and over again. For agents that require a user to authenticate on key access this is a nuisance
  • docker builder ls takes forever to return because it’s trying to connect to every context I have set up, and half of them require VPNs etc to be set up before they’re accessible

Fundamentally I think the first of these is the biggest issue. In a feature that can’t be disabled and isn’t well-documented, Docker is trying to make background connections to remote systems without a user asking it to.

If context-builders could be disabled, or better yet were opt-in per context, this would be a lot easier. As it is I either need to firewall off the systems I don’t want this connecting to so it doesn’t get as far as attempting an SSH connection, or not using the Context functionality which is otherwise really useful.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how buildx creates and connects context builders, especially the behavior observed through docker builder ls and remote Docker contexts. Define whether disabling builders globally or opting out per context is the intended behavior, then verify that background SSH attempts and builder listing no longer occur for disabled contexts.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.