Running docker first test - docker

I am a beginner to the docker technology, as I have downloaded it, the program doesn't launch. i Tested Docker --version and shows Docker version 18.06.1-ce, build e68fc7a.
I tried docker run hello-world as it appears in the tutorial, it shows the following error that i couldn't understand and fix, :
Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest: unauthorized: incorrect username or password.
any guide and better tutorial for fixing such problems and get improved with following step by step the technology and work on it?
Edit: Problem Solved!
in command line i have login and it was the key point where i get to run the test image.

Try create an dockerhub account. Then in your machine, type docker login. Then login by dockerhub account you just create... This should work.

Related

Unable to pull image from ghcr

For two days now I can't pull any image from the github container registry. This happens in both public and private images. I have tried with both cmd and windows terminal without success. From the docker hub, however, I pull normally.
The command I use is this:
docker pull ghcr.io/someorg/someimage:sometag
and the error i get is this:
Error response from daemon: Head "https://ghcr.io/v2/someorg/someimage/manifests/sometag": denied: denied
It just says "denied" without explaining "why"... All I found after a lot of searching was an issue on github which says it was a platform issue which has been resolved.
Since the images you are trying to pull are public and you get that error, it is safe to assume that you are logged in with an access token that no longer exists (because you probably deleted it or it expired).
Given this, you have to remove login credentials for ghcr.io using the following command:
docker logout ghcr.io
and either log in again with an existing access token or don't log in at all.
The pull command should then work.

Docker problem with sudo docker run hello-world: Gives Unable to find image error: Timeout

I am new to programming and I am currently learning Django.
In the book I am reading now, it requires me to use Docker. I followed every step, installed Docker accordingly to the site information, but something doesn't seem to work. When I type in the console
sudo docker run hello-world
this error comes up:
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.
I tried a lot of things, reinstalled docker a few times, and installed it a different way, nothing seems to work! I am using Pop Os 19.04 which is kind of equal to Ubuntu 19.04. Please help!
A friend of mine helped me. He just changed the DNS settings for IPv4 and IPv6 and it all works now!
Hi there is some existing solution for the same issue as far i know there is some DNS configuration you need to perform.
I will suggest please check these
stackoverflow #23111631 Link
Github link

docker push error "denied: requested access to the resource is denied"

This error occurs when trying to push an image to the public repository on Docker Hub. There have been no issues with other registries I have tried.
I have looked at numerous sites, blogs including StackOverflow and there is still no clear answer.
You can try to replicate this issue as follows.
As shown in the screenshot above, I have an image aspc-mvc-app on local docker host. As shown, it has 3 tags - 1.0.5, 1.0.5.latest and latest.
Assume that we are trying to push using an account name of janedoe at Docker Hub
Per documentation on Docker.io and numerous other sites, there are 3 steps to pushing.
(1) Login
docker login "index.docker.io" -u janedoe -p <password>
--> I get Login Succeeded which is good!
(2) Add one or more tags
Of the 3 tags, let's just tag the latest.
docker tag janedoe/aspc-mvc-app:latest janedoe/aspc-mvc-app
--> The prompt returns with no error. So far so good.
(3) Push
docker push janedoe/aspc-mvc-app
--> This is where the error occurs.
As shown on the screenshot below, initial checks seem to occur fine until you get the error denied: requested access to the resource is denied
At step (2), I have tried numerous other formats including the following.
docker tag janedoe/aspc-mvc-app:latest janedoe/aspc-mvc-app:latest
docker tag janedoe/aspc-mvc-app janedoe/aspc-mvc-app:latest
docker tag aspc-mvc-app:latest janedoe/aspc-mvc-app
docker tag aspc-mvc-app janedoe/aspc-mvc-app:latest
docker tag 306a8fd79d88 janedoe/aspc-mvc-app
docker tag 306a8fd79d88 janedoe/aspc-mvc-app:latest
All fail with the same error.
As a comparison, with the same exact image, I had no problem pushing to Azure Container Registry.
Since Docker Hub is so popular, can anyone shed light on what the mystery is, or if there is a detailed documentation anywhere?
Updated 5/9/2017
I am fairly up-to-date on docker cli and server versions. Right now, my cli is 17.05.0-ce-rc1 and server is 17.04.0-ce as shown below.
The solution is simply to change the way of logging in at step (1).
docker login -u janedoe -p <password>
Everything else can stay the way described above. The image was successfully pushed to Docker Hub!
First login by typing sudo docker login in the terminal. Enter username and password
Visit your docker account and create a new repository. In my case I created a repository crabigator1900/dockerhub
Say you have a docker image with repository name:crabigator/django and tag:latest.
In that case you will need to tag this image with a label of your wish. I decided to tag it with the label:myfirstimagepush. You tag the image by typing the command
sudo docker tag crabigator/django:latest crabigator1900/dockerhub:firstimagepush
Finally push the image to your repo using the command
sudo docker push crabigator1900/dockerhub:firstimagepush
That's all there is to it.
I too had the same issue, but after trying some combinations this worked.
Whenever you push - that refers to docker.io/ followed by registry path.
In my case my username is rushmith and I created a sample repository called docker under rushmith.
My link is : "hub.docker.com/r/rushmith/docker/"
Now I created a tag to my image that I want to push as: rushmith/docker
And It worked successfully.
$ docker login -u rushmith
(Give the password then type as below)
$ docker push rushmith/docker:latest
Output:
The push refers to a repository [docker.io/rushmith/docker]
7fbb0e1e64cb: Pushed
33f1a94ed7fc: Pushed
b27287a6dbce: Pushed
47c2386f248c: Pushed
2be95f0d8a0c: Pushed
2df9b8def18a: Pushed
latest: digest:
sha256:4d749d86b4a2d9304a50df474f6236140dc2d169b9aabc354cdbc6ac107390f2 size: 1569
I hope this late solution might help someone.
The reason of this error message was you haven't named your images properly.
Let say your account name on docker.io was your-name then your new repo name is going to be your-name/your-new-image-name.
In order to push your image, first you have to tag (name) your local images as:
docker tag local-image[:tag-name] your-name/your-new-image-name[:tag-name]
Things in the brackets is optional. You may want to check the result with docker image ls. Then let push your image to your docker repo:
docker push your-name/your-new-image-name[:tag-name]
Done! Your image was pushed to docker repos.
You can follow the following steps:
Step 1: docker login -u <username> -p <password>
A message with "Login Succeeded" will appear, confirming your successful login.
Step 2:
Now in order to push the image just make sure the path which you are using must have your username included in the tag.
e.g: Suppose link is: "hub.docker.com/u/xyz/"
Create a tag to image as docker push xyz/docker:latest.
If you already have some different tag change it using command
docker tag <old tag> <new tag>
Hope this helps.
after 1 hour's struggling with different ways mentioned above,
I reinstalled the neweast version of Docker Desktop app in my mbp, then it is solved.
the neweast version is 20.10.2
and the old version is 17.x, which was installed 5 years ago.
First you need to ensure you have logged into your account
You need to create a repository, below is the command to create a repository -
docker tag local-image:tagname YOUR-ACCOUNT-NAME/tagname
docker push YOUR-ACCOUNT-NAME/tagname
Create a repository from a website.
It possible that you don't have a permission for creating repository.
docker push does not create a repo name so if not present it says access not available
This worked for me.
> docker login -u janedoe
Password:
Login Succeeded
> docker tag myapp:0.0.1 janedoe/myflinkapp:0.0.1
> docker push janedoe/myapp:0.0.1
The push refers to repository [docker.io/janedoe/myapp]
b763be657a2c: Pushed
e534dae385a8: Pushed
5af3d5d57035: Pushed
0e44828b51e2: Pushed
fdd771f27095: Pushed
ef9a7b8862f4: Pushed
a1f2f42922b1: Pushed
4762552ad7d8: Pushed
0.0.1: digest: sha256:0069ee2c39b422e64f0493d2b2e9cbe7736a size: 2154
In my case, I was facing this issue even after logging into Docker registry successfully.
So, I tried running the docker push as sudo and it worked.
Make sure you follow these steps:
Run docker login
After logging in successfully, run the docker push command
If the push failed, run this: sudo docker push repoName:tagName
If you're using 2FA and run
docker login -u <your_docker_user_name>
you will get Login successful but you won't be able to push.
This is because you're using 2FA which requires one-time password to login into your account.
To be able to push with 2FA enabled you need to use an access token. To generate one go to Account settings/Security on Docker Hub website and click New Access Token. As of Access Permissions preferably choose Read & Write - this is the entry level for being able to push. Only generate Read, Write, Delete token if you really need it!
You'll be prompted with instructions on what to do next. Just to keep the answer full, you'll have to run
docker login -u <you_docker_username>
and when prompted for Password paste your Personal Access Token.
IMPORTANT: save your Personal Access Token in a password manager and never share with anyone and never push to github or add to your source code. NEVER! Please.
Now, when you run docker push <your_docker_username>/<your_docker_repo_name>:<tag_of_your_image> you should be able to push the image to the Docker Hub.
I have the same problem and it was solved by running the push command with sudo. I think it is only a privilege problem.
sudo docker push janedoe/aspc-mvc-app

docker pull fails (not found) yet "number of pulls" increases

I am running docker on CentOS 7 following the official documentation from https://docs.docker.com
When I try to pull a demo image I just created, I got this error:
FATA[0013] Repository not found
The strange thing is that the "Number of Pulls" increases every time I try to pull it. As if every pull is successful.
Every time I get this same error: FATA[0013] Repository not found
So what should I do now?
Lastest Update: Problem solved. Thanks to Jerry Baker, one of the Docker Staff.
Please refer to https://forums.docker.com/t/cant-find-or-pull-public-repos-on-docker-hub/1806/6
UPDATE: I am not running docker under a http_proxy.
UPDATE 2: #user2915097 After I run docker events:
UPDATE 3:
My repo was not even found by docker search:
UPDATE 4:
docker push failed, too. I've already logged in (by docker login).
docker pull wings27/centos-web-dev is not working because it does not have the 'latest' tag. It tries to pull the 'latest' tag by default if you do not provide any tag in your pull command.
Login to your docker account before accessing private repos
docker login
If it still helps, short answer
docker login
docker tag <image_id> wings27/centos-web-dev:<your-tag>
docker pull wings27/centos-web-dev:<your-tag>

can't build the docker image with error saying image not found

I am trying to build a docker image from public repository. Actually I had built it successfully before, today I wanted to update the image to latest one, so I removed the older image, and tried to pull the new image.
However, when I tried
$ docker pull dockerfile/ghost
Pulling repository dockerfile/ghost
FATA[0001] Error: image dockerfile/ghost:latest not found
I can't really understand why it doesn't work, it is supposed to be working.
This is what you need
Use docker pull ghost.
Thanks, #Chandan. I followed his advice to find the problem through
docker logs container_id
Firstly, the error is
ERROR: casper cannot be activated because it is not currently
installed.
so I downloaded the casper and put it into the theme folder.
Secondly, the error is
Migrations: Up to date at version 003 Ghost is running in
development... Listening on 127.0.0.1:2368 Url configured as:
http://localhost:2368
because the ghost server is running in the development mode.so I make it as production mode.
Thirdly, by making it into the production mode, there is a error
ERROR: Unable to access Ghost's content path:
so I followed the instruction to edit /path/to/ghost/blog/config.js and copy the paths section from development to production. Then restart the container.
docker restart some-ghost
at last it works
Replace
docker pull dockerfile/ubuntu
with
docker pull ubuntu
Similarly in Dockerfile for base image pull, replace
FROM dockerfile/ubuntu
with
FROM ubuntu
Change ubuntu to any other image name you require

Resources