install docker container - docker run - invalid reference format - docker

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.

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

Problem running docker image from my own public repo from docker hub

I have a repo in docker hub named shaktidocker and it is public. I have a image in the repo.
When i am trying to run that image from my local docker development host using next command:
docker run -P -d shaktidocker/docker-spring-boot-demo
It gives me below error:
e75c891fa5403b0bb6ed1aa3b5e6a6760d4707219ecaff22727632cca741fa25
/usr/bin/docker-current: Error response from daemon: linux spec user:
unable to find user shaktidocker: no matching entries in passwd file.
When I am trying t run a different image from different public repo, it works perfectly fine.
Please, advise
The Dockerfile you used most likely contains the line:
USER shaktidocker
This is defining the Linux user inside the container to run commands, not your user ID on docker hub. Most likely you want to delete this line from your Dockerfile, rebuild, push, and pull your image, before trying to run it again.
It looks like for some reason when you want to start your container by default the name of repository is used as default username to run the container. This username does not exist in the underlying system hence container cannot start.
You can try to define a user with which you will start the image:
docker run -P -d --user nobody shaktidocker/docker-spring-boot-demo
This way you should be able to start your container.

Docker asking for login in windows 10

I issued a command "docker build -t httpd ."from bash with preconfigured docker file having
FROM httpd.latest .
Once command is executed and after step 1 it says "pull access denied for httpd.latest, repository does not exist or may required docker login.
Yes , image which you are using might not exixts in public dockerhub
First search image using
docker search httpd
If you can find that then you need to create on
https://github.com/docker-library/httpd/blob/c14a031c014aa2219aea2e73786f577300756f0b/2.2/Dockerfile
In your dockerfile use
FROM httpd
not latest,
docker will pull latest image if tag is not specified or use specific version

Docker pull or Docker run doesn't actually do anything

I'm trying to run something called Traildash via it's docker container on a VM via chef (once I get it running I'll move it to an AWS instance). So I've installed docker onto the VM and so I tell chef to run
docker run -i -d -p 80:80 \
appliedtrust/traildash
or even
docker pull appliedtrust/traildash
on the VM and all it does is:
Unable to find image 'appliedtrust/traildash' locally
Pulling repository appliedtrust/traildash
2015/03/16 12:40:38 Get https://index.docker.io/v1/repositories/appliedtrust/traildash/images: x509: certificate is valid for ssl7302.cloudflare.com, *.archeagemall.co
m, *.astrubbank.com, *.billhr2847.com, *.dallasjuniorforum.org, *.goudportal.nl, *.habbinfo.info, *.hoistandcrane.com, *.jlfresno.org, *.jlknoxville.org, *.jlsantabarbara.org, *.jl
wichita.org, *.jrleagueabilene.com, *.okaygoods.com, *.pbajf.org, *.stansberryonline.com, *.unfairmovie.com, *.usepnd.com, *.vaccineinjuryhelpcenter.com, archeagemall.com, astrubba
nk.com, billhr2847.com, dallasjuniorforum.org, goudportal.nl, habbinfo.info, hoistandcrane.com, jlfresno.org, jlknoxville.org, jlsantabarbara.org, jlwichita.org, jrleagueabilene.co
m, okaygoods.com, pbajf.org, stansberryonline.com, unfairmovie.com, usepnd.com, vaccineinjuryhelpcenter.com, not index.docker.io
and then nothing, the container won't actually start nor do I see any files pulled unless docker pulls the files into a different directory?
What do I do to get this running?
You doing everything right. But if you running it outside of EC2 (with IAM Role setted up), you have to explicitly pass AWS creds and optionally other parameters. For more information take a look at https://github.com/AppliedTrust/traildash#quickstart

Resources