Skip to content

Proposal: deprecate "docker run" pulling unknown containers and add explicit "--pull" flag #10693

@tianon

Description

@tianon

While having docker run automatically pull images that don't exist locally is nice for first-time users (since they can just docker run some-image and see the magic happen), it can be very frustrating for more experienced users who want to control the images they have and run on their host, especially since a pull cannot be cancelled except by restarting the entire daemon. A stray docker run of the wrong image in the wrong terminal, for example, is a very frustrating situation to be in, especially since you then get to wait for that image to download (or not wait and then try to remember to delete it afterwards).

In other cases (especially scripted ones), docker pull some-image && docker run some-image emerges as a very common pattern. For consistency with the new docker build --pull, I propose the addition of docker run --pull (ideally implemented daemon-side like docker build --pull is), which will default to false and thus change:

$ docker run --rm lolimage
Unable to find image 'lolimage:latest' locally
Pulling repository lolimage
FATA[0002] Error: image library/lolimage:latest not found 

into:

$ docker run --rm lolimage
FATA[0002] Error: image library/lolimage:latest not found 

Since this is a broader proposal than #10639 (deprecating an existing "feature"), I opted to make a new one instead of just commenting there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliClientarea/distributionImage Distributionkind/featureFunctionality or other elements that the project doesn't currently have. Features are new and shiny

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions