<p>To push, you need write access to the destination repository. With Docker Hub, those repositories must be under your userid, or in an organization where you have write access. The default path you see added, <code>docker.io/library</code>, is used by official images, which makes pulling official images easier. But since you aren't the author of docker official images, that won't work for pushing.</p>
<p>That means you need to:</p>
<pre><code>docker build -t your-user/your-image:v1 .
docker push your-user/your-image:v1
</code></pre>
<p>Where <code>your-user</code> is the same user you used when running <code>docker login</code>.</p>

CC BY-SA 4.0
2022-05-15T15:58:36.743Z
2022-05-15T15:58:36.743Z
BMitch
<p>Here are the steps that worked for me:</p>
<ol>
<li>docker logout (if already logged in)</li>
<li>docker login</li>
<li>docker build . -t </li>
<li>docker tag  /:</li>
<li>docker push /:</li>
</ol>
<p>Before pushing the image we need to tag it with the a name to be displayed on the repository by providing the location to the docker hub repository/registry and the tag name.</p>
<p>Thanks!</p>

CC BY-SA 4.0
2023-09-03T06:42:03.380Z
2023-09-03T06:42:03.380Z
shade0
<p>you need to login on your console to your docker registry the push the image to the local or public registry.</p>
<pre><code>docker login registry.mydomain.xxx:5000
username: xxxx
password: xxxx
docker push registry.mydomain.xxx:5000
</code></pre>

CC BY-SA 4.0
2022-06-13T03:50:02.050Z
2022-06-13T03:50:02.050Z
Iyus Dedi Putra
<p>I have created a new docker image with a</p>
<pre><code># docker build -t my-phpapache:7.4 .
</code></pre>
<p>Now, when I try to make</p>
<pre><code># docker image push
</code></pre>
<p>I'm logged in to a Docker hub in a browser. I see the errors:</p>
<pre><code>$ docker image push --all-tags docker.io/library/my-phpapache
The push refers to repository [docker.io/library/my-phpapache]
f04ed43187a6: Preparing 
0ff1b9aaef0c: Preparing 
c18803e039cd: Preparing 
a735fdc00d49: Preparing 
de7c912f2726: Preparing 
e835c99ddfc4: Waiting 
1f55d9e78afa: Waiting 
5aefa6797d83: Waiting 
70af74272d2e: Waiting 
58e3131f3b01: Waiting 
a1bae98a9430: Waiting 
752cff7a1101: Waiting 
be3607e92e69: Waiting 
2ffebc0bdeea: Waiting 
4c94b016478b: Waiting 
a9019c838a13: Waiting 
015643a98838: Waiting 
f2c64a370cec: Waiting 
d5b8874e6c41: Waiting 
9eb82f04c782: Waiting 
denied: requested access to the resource is denied
</code></pre>

CC BY-SA 4.0
2022-05-12T14:01:58.113Z
You need to log in through the CLI to achieve a push. Please look at this [Link](https://stackoverflow.com/questions/41984399/denied-requested-access-to-the-resource-is-denied-docker?page=1&tab=modifieddesc#tab-top).
Kristian Kanchev
CC BY-SA 4.0
2022-05-12T14:11:04.610Z
Thank you, Kristian Kanchev, I've tried your instructions. Logged out, generated Access token with a full access. I've logged in with it. I've repeated docker image push --all-tags docker.io/library/my-phpapache and I see the same error message: "denied: requested access to the resource is denied"
Taras
CC BY-SA 4.0
2022-05-12T14:44:27.447Z
Can you try to be more specific with your push, maybe have a look at [this](https://stackoverflow.com/a/42300879/6135564)?
Kristian Kanchev
CC BY-SA 4.0
2022-05-12T15:33:37.400Z
$ docker logout
Removing login credentials for https://index.docker.io/v1/
$ 
$ docker login -u shtaras
Password: 
Login Succeeded
$ 
$ docker image push --all-tags docker.io/library/my-phpapache
The push refers to repository [docker.io/library/my-phpapache]
f04ed43187a6: Preparing 
...
9eb82f04c782: Waiting 
denied: requested access to the resource is denied
$
Taras
<docker>
docker image push does not work
Taras
# docker image push does not work

(Asked by: username_0 on 2022-05-12)

I have created a new docker image with a
# docker build -t my-phpapache:7.4 .

Now, when I try to make
# docker image push

I'm logged in to a Docker hub in a browser. I see the errors:
$ docker image push --all-tags docker.io/library/my-phpapache
The push refers to repository [docker.io/library/my-phpapache]
f04ed43187a6: Preparing 
0ff1b9aaef0c: Preparing 
c18803e039cd: Preparing 
a735fdc00d49: Preparing 
de7c912f2726: Preparing 
e835c99ddfc4: Waiting 
1f55d9e78afa: Waiting 
5aefa6797d83: Waiting 
70af74272d2e: Waiting 
58e3131f3b01: Waiting 
a1bae98a9430: Waiting 
752cff7a1101: Waiting 
be3607e92e69: Waiting 
2ffebc0bdeea: Waiting 
4c94b016478b: Waiting 
a9019c838a13: Waiting 
015643a98838: Waiting 
f2c64a370cec: Waiting 
d5b8874e6c41: Waiting 
9eb82f04c782: Waiting 
denied: requested access to the resource is denied

**Tags:** docker

> **Comments:**
> **username_1**: You need to log in through the CLI to achieve a push. Please look at this [Link](https://stackoverflow.com/questions/41984399/denied-requested-access-to-the-resource-is-denied-docker?page=1&tab=modifieddesc#tab-top).  
> **username_0**: Thank you, username_1, I've tried your instructions. Logged out, generated Access token with a full access. I've logged in with it. I've repeated docker image push --all-tags docker.io/library/my-phpapache and I see the same error message: "denied: requested access to the resource is denied"  
> **username_1**: Can you try to be more specific with your push, maybe have a look at [this](https://stackoverflow.com/a/42300879/6135564)?  
> **username_0**: $ docker logout Removing login credentials for https://index.docker.io/v1/ $  $ docker login -u shtaras Password:  Login Succeeded $  $ docker image push --all-tags docker.io/library/my-phpapache The push refers to repository [docker.io/library/my-phpapache] f04ed43187a6: Preparing  ... 9eb82f04c782: Waiting  denied: requested access to the resource is denied $  

---

## 3 answers

### Answer by username_2 on 2022-05-15. Score: 1 | Accepted answer

To push, you need write access to the destination repository. With Docker Hub, those repositories must be under your userid, or in an organization where you have write access. The default path you see added, docker.io/library, is used by official images, which makes pulling official images easier. But since you aren't the author of docker official images, that won't work for pushing.
That means you need to:
docker build -t your-user/your-image:v1 .
docker push your-user/your-image:v1

Where your-user is the same user you used when running docker login.


---

### Answer by username_3 on 2023-09-03. Score: 0

Here are the steps that worked for me:

1. docker logout (if already logged in)
2. docker login
3. docker build . -t
4. docker tag /:
5. docker push /:

Before pushing the image we need to tag it with the a name to be displayed on the repository by providing the location to the docker hub repository/registry and the tag name.

Thanks!


---

### Answer by username_4 on 2022-06-13. Score: 0

you need to login on your console to your docker registry the push the image to the local or public registry.
docker login registry.mydomain.xxx:5000
username: xxxx
password: xxxx
docker push registry.mydomain.xxx:5000


---

