0

I created an image called "helloworld" based on some project I have.

If I run :

docker images

I can see it there on top of the list.

enter image description here

Now if I want to run it, docker complains it does not exist.

Running this :

docker run -p 8080:8080 helloworld

returns this :

docker: Error response from daemon: pull access denied for helloworld, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. See 'docker run --help'.

Why is docker complaining that my image does not exist?

3 Answers 3

2

It complains, because this:

docker run -p 8080:8080 helloworld

is a shortened version of this:

docker run -p 8080:8080 docker.io/library/helloworld:latest

and, based on the screenshot, your image is called

docker.io/library/helloworld:1.0

so the proper command (skipping default prefix) is:

docker run -p 8080:8080 helloworld:1.0
1

Other answers are correct but don't explain clearly why they are correct.

The docker run command expects an image name and, optionally, a tag (i.e., docker run IMAGE[:TAG]). If a tag is not provided, the default is latest.

Running docker run helloworld is equivalent to docker run helloworld:latest, but this image does not exist in the OP's system according to docker images.

The solution is to specify the image tag: helloworld:1.0.

1

Your image build command:

docker build --rm -f "Dockerfile" -t helloworld:1.0 "."

Meaning your image name is helloworld:1.0

If you had run docker build --rm -f "Dockerfile" -t helloworld "."

Then your image name is helloworld or helloworld:latest and your first try would have worked.

To solve your issue run this instead:

docker run -p 8080:8080 helloworld:1.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.