Unable to find image locally - docker

I have a docker image:
$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
elucidbio/capcompute local a5ed348be9f8 About a minute ago 2.27GB
But when I try and start it, it fails:
$docker run --name capcompute elucidbio/capcompute
Unable to find image 'elucidbio/capcompute:latest' locally
docker: Error response from daemon: repository elucidbio/capcompute not found: does not exist or no pull access.
What stupid thing am I missing here?

Your tags dont match. Your local image tag is "local" but its looking for "latest" because you didn't specify a tag. To run it you should append the tag of "local".
docker run --name capcompute elucidbio/capcompute:local

Related

Create custom image with Dockerfile and directly run it locally on Win10

My humble Dockerfile looks like this:
# Dockerfile.Ubuntu
FROM ubuntu:latest as builder
RUN ["touch", "test"]
when building the new image with
docker build -f Dockerfile.Ubuntu -t "Dummy:1.0" .
and issuing docker images the newly created images is listed
REPOSITORY TAG IMAGE ID CREATED SIZE
Dummy 11.2 3bffa7d3048d 27 minutes ago 64.2MB
but now, when starting the image with the name docker run -it Dummy bash i receive this error:
Unable to find image 'Dummy:latest' locally C:\PATH....exe: Error response from daemon: pull access denied for Dummy, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
Using the image id works: docker run -it 3bffa7d3048d bash
and i also see the added file /test
Note: I tried all kind of character combinations (camel case, lowercase only..) with the same result.
What do i have to change to start my local image directly by name?
You're just missing the tag in your run command.
docker run -it Dummy:11.2 bash

docker run results in "unable to find image" if linked container not found

I'm getting possibly incorrect behavior and a bad error message if I run an image if a linked container is not found:
# this works:
> docker run --rm -d --name natsserver nats
> docker run --rm -it --name hello-world --link natsserver hello-world
# now stop natsserver again...
> docker stop natsserver
When I run hello-world again with the same command, I don't understand the first part of the error handling - why does docker try to pull?
> docker run --rm -it --name hello-world --link natsserver hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
Digest: sha256:b8ba256769a0ac28dd126d584e0a2011cd2877f3f76e093a7ae560f2a5301c00
Status: Image is up to date for hello-world:latest
docker: Error response from daemon: could not get container for natsserver: No such container: natsserver.
See 'docker run --help'.
And things get even worse if I try to run an image I have built locally:
> docker build -t nats-logger .
[...]
Successfully tagged nats-logger:latest
> docker run --rm -it --name nats-logger --link=natsserver nats-logger
Unable to find image 'nats-logger:latest' locally
docker: Error response from daemon: pull access denied for nats-logger, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
So my questions are:
a) Is docker allowed to try to pull in this case, or is this a bad behavior?
b) Is this really a bad error message, or did I miss something?
P.S.: I'm running Docker version 19.03.2, build 6a30dfc on Windows 10.
Is docker allowed to try to pull in this case
Docker will pull image if it is not available on the machine.
Unable to find image 'hello-world:latest' locally
This warning message is not due to linking, it is because hello-world:latest is not exist in your system local images. so whe run docker run it will look on local then will pull from remote if not exist.
Now First thing, Better to use docker-compose instead of Legacy container links.
You can not link the container if it's not running. verify the container natsserver using docker ps and then if it is running then you can link.
docker run --rm -it --name hello-world --link natsserver:my_natserver_host hello-world
Once up you can then check the linking.
docker inspect hello-world | grep -A 1 Links
Legacy container links
Warning: The --link flag is a legacy feature of Docker. It may
eventually be removed. Unless you absolutely need to continue using
it, we recommend that you use user-defined networks to facilitate
communication between two containers instead of using --link. One
feature that user-defined networks do not support that you can do with
--link is sharing environment variables between containers. However, you can use other mechanisms such as volumes to share environment
variables between containers in a more controlled way.
simply try "docker login".
check if your image name is exist in docker hub
and check correct docker build command -> docker build -t image-name .
review the correctness of Docker file script

install docker container - docker run - invalid reference format

From the docker quickstart terminal on Windows 7 64-bit, I'm following the instructions to install this docker container. I run the command,
docker run http://wiki.openstreetmap.org/wiki/nominatim
and I get this error:
c:\program files\docker toolbox\docker.exe: invald reference format.
I can't find any information about this error related to this container.
You need to pull the image first , then run the container. according to your docker command, you are trying to access a website, it is not a docker container image. so that's why it is giving you the invalid reference format.
The image name that you have specified to pull and run is wrong. The image name should be mediagis/nominatim.
Your docker run command should be
docker run mediagis/nominatim
It is not necessary to pull the image first and run it. By default docker run first tries to find such image in your machine if not then it tries to download from docker repository.
If you specify URL format it directly downloads from private repo if such image is not found in your machine.
Brief Explanation:
Docker takes whatever that is in form of url as an image and the reason for this is sometimes you may want to run image from your private repository. So here http://wiki.openstreetmap.org/wiki/nominatim is considered as an image called wiki/nominatim from a private repo called wiki.openstreetmap.org by docker and the format of private repo and image is wrong . It should be <domain.com>/image:tag where tag is optional. You are not supposed to provide protocol (http://). See this for reference Hence the error is thrown as invalid reference format.
If you would have given as docker run wiki.openstreetmap.org/wiki/nominatim it would have tried to download image called wiki/nominatim from wiki.openstreetmap.org private repo with latest tag. Since no such repo and image exists it reports Error response from daemon: error parsing HTTP 404 response body as the url throws 404: Not Found when docker daemon tries connecting to it.
References:
Pull an image from Docker Hub
Pull from a different registry
docker run
Docker run reference
Note: Unless you specify tag name which is optional docker always downloads latest tag from repo.
docker run http://wiki.openstreetmap.org/wiki/nominatim
does non make any sense syntactically ...
In any case the correct command to get the latest image is:
sudo docker pull mediagis/nominatim:3.1
Notice that each version has its own installation instructions (versions prior to 3.1 were structurally different), so please do refer to the appropriate section:
https://hub.docker.com/r/mediagis/nominatim/tags/
However I do agree with you that
docker run --restart=always -p 6432:5432 -p 7070:8080 -d -v /home/me/nominatimdata/postgresdata:/var/lib/postgresql/9.5/main nominatim sh /app/start.sh
Should be
docker run --restart=always -p 6432:5432 -p 7070:8080 -d -v /home/me/nominatimdata/postgresdata:/var/lib/postgresql/9.5/main mediagis/nominatim sh /app/start.sh
instead. The installation instructions need updating there.

Where can i get docker image off line?

In my working environment , i can't connect to the network, but i can connect to the download machine ,which can connect to network .
But i do not know how to find a docker image and download it .
The website docker hub just show the command such as "docker pull nginx" , but i can't connect to the network ,it is useless for me .
My question:
Now, I have install docker by download docker-engine.deb.
where can I get a docker image off line?
You'll need access to a registry where docker images are stored. But if you don't have images and no registry with images yet, than you have to pull the image from the internet.
A recommended way could be:
Install docker on a machine (maybe your local machine) with internet access and pull an image:
$ docker pull busybox
Use docker save to make a .tar of your image
$ docker save busybox > busybox.tar
or you can use the following syntax
$ docker save --output busybox.tar busybox
Reference is here.
You can use a tool like scp to send the .tar to your Docker server where you don't have internet access.
Now you can use docker load to extract the .tar and get your image:
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
$ docker load < busybox.tar.gz
Loaded image: busybox:latest
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
busybox latest 769b9341d937 7 weeks ago 2.489 MB
Reference is here

Unable to find image latest locally

When I run docker ps I can see the following image running:
6ec29fa046f0
But when I do docker run -i 6ec29fa046f0:
Unable to find image '6ec29fa046f0:latest' locally
Pulling repository docker.io/library/6ec2af9064f0
docker: Error: image library/6ec29fa046f0:latest not found.
So how can I see this image in docker ps but I can't run it locally?
What you are seeing is the identifier of a running container started from an image.
You can see the images by running:
docker images
You can also check what image is that container using by issuing:
docker inspect <identifier>
When you are using docker ps you can see the name or ID of the image.
In your case, this is ID of the image.
To find the name of the image you can try to use docker images | grep "your_id"

Resources