Docker pushをすると、”denied: requested access to the resource is denied”と言われて失敗する件

Docker commitで作ったイメージをアップしてみようと思って、docker pushを使ってみたんだけど、上手く動きませんでした。

ebata@DESKTOP-P6KREM0 MINGW64 ~/xxxxxxx_ride_hailing_go
$ docker push ebata_db_data_1_back2
The push refers to repository [docker.io/library/ebata_db_data_1_back2]
d103f95b4a98: Preparing
195be5f8be1d: Preparing
denied: requested access to the resource is denied

ebata@DESKTOP-P6KREM0 MINGW64 ~/xxxxxxx_ride_hailing_go
$ docker push ebata_db_data_1_back2
The push refers to repository [docker.io/library/ebata_db_data_1_back2]
d103f95b4a98: Preparing
195be5f8be1d: Preparing
denied: requested access to the resource is denied

なんで上手くいかないのかなー、とググッてみたら、イメージ名にルールがあったみたいです。ユーザ名がtomoichiならば、image作る時に、こういう名前にしなければダメみたい。

ebata@DESKTOP-P6KREM0 MINGW64 ~/xxxxxxx_ride_hailing_go
$ docker commit f5ae64d47096 tomoichi/ebata_db_data_1_back2
sha256:bf565f55a2cf06e0c9fe6ecb3460f7afe7228cf48886ae0a71cde6bf770ebf1c

ebata@DESKTOP-P6KREM0 MINGW64 ~/xxxxxxx_ride_hailing_go
$ docker commit 64101530c199 tomoichi/ebata_db_1_back2
sha256:6243b4ad2ea96bca6183b331a1c2c4467c9337ce2b305e40ca6a1d456b58df8d

でもって、

ebata@DESKTOP-P6KREM0 MINGW64 ~/xxxxxxx_ride_hailing_go
$ docker push tomoichi/ebata_db_data_1_back2
The push refers to repository [docker.io/tomoichi/ebata_db_data_1_back2]
d103f95b4a98: Preparing
195be5f8be1d: Preparing
d103f95b4a98: Pushed
195be5f8be1d: Pushed
latest: digest: sha256:e69eb3011f892fc5fe80530657f2ed0c1b59202cdca62788483315412a54be50 size: 734

みたいに成功するようです。

2020/07,江端さんの技術メモ

Posted by ebata