docker / docker/docker-py

Importing class Image and class Container

Open
#2,756 2 comments 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

According to the documentation for version 4.4, there exist Image and Container classes. I'm passing containers and images to functions and I use type annotations, so in order to be able to write type annotations for my functions I need to have those types defined.

I tried to use docker.Image and docker.Container, because the documentation didn't specify anything in particular about where to find those types and so I was expecting them in the main namespace. That doesn't work, but some searching through the source code got me docker.models.images.Image and docker.models.containers.Container, which I can import and use.

My question is, are these classes in those modules part of the stable API? If so, perhaps the documentation could point out how to import them correctly to save others some searching? Thanks!

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 with the linked Image and Container documentation and the import paths docker.models.images.Image and docker.models.containers.Container mentioned in the issue. Confirm whether those classes are intended as stable public types, then document the supported imports and verify the examples show how to use them in type annotations.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
api, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.