Skip to content

Running invoke commands leaves orphaned containers #810

@joewesch

Description

@joewesch

Environment

  • Python version: 3.11.13
  • netutils version: 1.17.2a0

Expected Behavior

I expect that when I run invoke pytest that the container removes itself afterwards

Observed Behavior

The docker container remains stopped:

❯ docker ps -a
CONTAINER ID   IMAGE                          COMMAND                  CREATED          STATUS                     PORTS                                         NAMES
bb685d65df9e   netutils:latest                "sh -c 'pytest -vv -…"   13 seconds ago   Exited (0) 2 seconds ago                                                 hungry_gould

Running invoke clean removes the image, but not the container:

❯ inv clean
Attempting to forcefully remove image netutils:latest
Untagged: netutils:latest
Deleted: sha256:d06d2f9af6984b8de924877dddcbef785a00501646775516c1766c9c0747ed51
Successfully removed image netutils:latest
❯ docker ps -a
CONTAINER ID   IMAGE                          COMMAND                  CREATED          STATUS                     PORTS                                         NAMES
bb685d65df9e   d06d2f9af698                   "sh -c 'pytest -vv -…"   3 minutes ago    Exited (0) 3 minutes ago                                                 hungry_gould

Steps to Reproduce

  1. Run invoke build
  2. Run invoke pytest
  3. Run docker ps -a to see all stopped containers

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions