docker / docker/docker-py

Contexts not found when there is no config.json

Open
#3,190 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
1.7k
Avg merge
13d 8h
Merged PRs (30d)
2

Description

docker.context.config.get_meta_dir() indirectly depends on docker.utils.config.find_config_file(), which fails if ~/.docker exists but ~/.docker/config.json doesn't.

For example:

$ find ~/.docker
/home/astraluma/.docker
/home/astraluma/.docker/buildx
# ... skipping all the buildx stuff ...
/home/astraluma/.docker/.token_seed.lock
/home/astraluma/.docker/.token_seed
/home/astraluma/.docker/contexts
/home/astraluma/.docker/contexts/meta
/home/astraluma/.docker/contexts/meta/9bfaad6047affcb5aea9994b8886dc52eec0e2f0803f79fb9f2ac4277d037666
/home/astraluma/.docker/contexts/meta/9bfaad6047affcb5aea9994b8886dc52eec0e2f0803f79fb9f2ac4277d037666/meta.json

This causes the docker python client to fail to find any contexts.

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 docker.context.config.get_meta_dir() into docker.utils.config.find_config_file(), focusing on the behavior when ~/.docker exists without config.json. Reproduce the missing-config case using the context metadata layout described in the issue; done means the Docker Python client can discover contexts in that situation.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.