Welcome to the Linux Foundation Forum!

How to push the image to hub.docker.org (Lab 7.1)

devdorrejo
devdorrejo Posts: 24
edited January 15 in LFS253 Class Forum

Hello, the document is a little short on how to do a push image in hub.docker.com.

Why now is difference? docker have made some change and limitation for normal users, maybe for the demand or something else (i didn't dig into this).

So let's go to the main topic

In the labs, we will be making a push to our repository on hub.docker.com, but will fail with the next error: denied: requested access to the resource is denied

This happen because in the direct push with the lfstudent hostname/username, is not our username account on hub.docker.com.

To be a little more clear, the part of a docker repository is the next:

first username lfstudent/second image_name:third tag

so doing a docker image push lfstudent/alpine:training will fail because our user is not lfstudent, it is the one you assign when creating the account on hub.docker.com.

So you need to follow the next steps:

$USERNAME_HUB.DOCKER.COM => Is the username account you created on hub.docker.com

  1. After login docker login
  2. docker tag lfstudent/alpine:training $USERNAME_HUB.DOCKER.COM/alpine:training
  3. docker image push $USERNAME_HUB.DOCKER.COM/alpine:training
  4. visit the repository page of hub.docker.com

Comments

  • For the next Labs, i recommend that replace lfstudent with you hub.docker.com username, if there is more push

  • chrispokorni
    chrispokorni Posts: 1,465

    Hi @devdorrejo,

    Thank you for your feedback. The exercise assumes the existence of such an account, the reason why no password is actually provided:

    Assuming the existence of a lfstudent account on Docker Hub ...

    Regards,
    -Chris

Categories

Upcoming Training