I need help how to switch from image registry server from docker.io to quay.io. My cases is I pull centos image from hub.docker.com and I want to push it to quay.io. I have login to my quay.io but when I try to push to quay like this shell that was not working. Here are my step to switch to quay.io:
- Create quay repository MYUSERNAME/centos
- Logout from docker.io
# docker logout docker.io
- Login to quay.io
# docker login quay.io
- I fill the credential
- I create new tag
# docker tag IMAGEID MYUSERNAME/centos:7
- I push my image to quay
# docker push MYUSERNAME/centos:7
Here is output I got for the last shell command:
The push refers to repository [docker.io/MYUSERNAME/centos] 2653d992f4ef: Preparing denied: requested access to the resource is denied
I can see that registry image server still pointed to docker.io.
How to solve this? Thank you.
Advertisement
Answer
In super short, the tag is in format site/something/name:tag
where:
- if
site
is missing, it is assumed to bedocker.io
(can’t be changed) - if
something
is missing, it is assumed to belibrary
. - if
:tag
is missing, it is assumed to be latest.
So for example docker pull alpine
is the same as docker pull docker.io/library/alpine:latest
.
If you want to use a repository with different address, you have to explicitly give its name when tagging:
docker tag IMAGEID quay.io/MYUSERNAME/centos:7 docker push quay.io/MYUSERNAME/centos:7