使用docker出现如下问题

这段代码是在编译生成我自己的docker image,名字叫koa2jain,版本是v1,报错说unauthorized

jain@MacBook-Pro koa2_jain (master) $ docker build -t koa2jain:v1 .
Sending build context to Docker daemon  7.069MB
Step 1/8 : FROM node:8
Get https://registry-1.docker.io/v2/library/node/manifests/8: unauthorized: incorrect username or password

原因是本地登陆信息已经过期了,需要重新登陆;

解决办法如下:

jain@MacBook-Pro koa2_jain (master) $ docker login
Authenticating with existing credentials...
Stored credentials invalid or expired
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username (yu36XXXXXXXX.com): yu36yuqing
Password:
Login Succeeded

记得Username是用docker id的,如果不知道docker id请登录https://hub.docker.com/
下图右上角就是docker id了
docker id 看这里
登录成功后,就可以正常操作了。

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐