Skip to content

[BUG] --link to unexisting container yelds to pulling again image #3871

@aijanai

Description

@aijanai

Starting a container that is linked to a non existing container should fail and just report an appropriate message.

Instead, docker tries to pull the image we are trying to launch, first, then acknowledges we already have that and then fails the launch with the aforementioned error message.
Pulling the image has nothing to do with this, it should just fail.

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID: 199DD8FB-810A-433B-8AE3-58DB70C5F521/20190827140253

Expected behavior

Container should fail with following error message:

docker: Error response from daemon: could not get container for asd: No such container: asd.
See 'docker run --help'.

Actual behavior

Container fails, but it tries first to pull the image we already own:

Unable to find image 'nginx:alpine' locally
alpine: Pulling from library/nginx
Digest: sha256:e0f88b21626f56e5d9e038da863aee331640efb03ca7d8f453ed8243343acfaa
Status: Image is up to date for nginx:alpine
docker: Error response from daemon: could not get container for asd: No such container: asd.
See 'docker run --help'.

Information

  • macOS Version: 10.14.6

Diagnostic logs

Docker for Mac: 2.1.0.1 (37199)

Steps to reproduce the behavior

Start any container (here nginx:alpine for example) with a --link to a non existing running container:

docker run --rm --link asd nginx:alpine

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions