Docker run fails on custom image with `docker: you are not authorized to perform this operation: server returned 401.`

  docker, fedora

Docker installed as per https://docs.docker.com/engine/install/fedora/

Why can I run the original pulled image from dockerhub but if I build a version locally it wont run and fails with the error in the subject. But sudoing the image works. What permissions am I missing

[[email protected]:~/image]$ docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
fedora       33        b3048463dcef   5 weeks ago   175MB
[[email protected]:~/image]$ docker run -it fedora:33
[[email protected] /]# echo "worked"
worked
[[email protected] /]# exit

Build image

[[email protected]:~/image]$ echo "FROM fedora:33" | docker build -t my_image:v1 -
Sending build context to Docker daemon  2.048kB
Step 1/1 : FROM [email protected]:aa889c59fc048b597dcfab40898ee3fcaad9ed61caf12bcfef44493ee670e9df
 ---> b3048463dcef
Successfully built b3048463dcef
Successfully tagged my_image:v1
Tagging [email protected]:aa889c59fc048b597dcfab40898ee3fcaad9ed61caf12bcfef44493ee670e9df as fedora:33


[[email protected]:~/image]$ docker images
REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
my_image     v1        b3048463dcef   5 weeks ago   175MB
fedora       33        b3048463dcef   5 weeks ago   175MB


[[email protected]:~/image]$ docker run -it my_image:v1
docker: you are not authorized to perform this operation: server returned 401.
See 'docker run --help'.


[[email protected]:~/image]$ sudo docker run -it my_image:v1
[sudo] password for user:
[[email protected] /]# echo "only works with sudo"
only works with sudo
[[email protected] /]# exit

Source: Docker Questions

LEAVE A COMMENT