Skip to content

NotFound where ImageNotFound exception expected #3095

@binitshah

Description

@binitshah

Hello! If I asked docker-py's container.run() method to launch a container that didn't exist, I'd expect a docker.errors.ImageNotFound exception based on the docs. This holds true if the Docker ID doesn't exist, but when the ID exists and the repo name doesn't, I instead get docker.errors.NotFound.

To reproduce this, run:

self.client.containers.run("<realuser>/<fakerepo>", auto_remove=True, detach=True, name="whatever")

or

self.client.containers.run("<realuser>/<fakerepo>:<whatevertag>", auto_remove=True, detach=True, name="whatever")

I'm running Ubuntu 20.04, Python 3.8.10, docker-py==6.0.1, and docker version:

Client:
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.2
 Git commit:        20.10.12-0ubuntu2~20.04.1
 Built:             Wed Apr  6 02:14:38 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.12
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.2
  Git commit:       20.10.12-0ubuntu2~20.04.1
  Built:            Thu Feb 10 15:03:35 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.5.9-0ubuntu1~20.04.6
  GitCommit:        
 runc:
  Version:          1.1.0-0ubuntu1~20.04.2
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:        

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions