PS C:\Users\xxx> docker run -it --rm tomcat:8.0
Unable to find image 'tomcat:8.0' locally
8.0: Pulling from library/tomcat
f189db1b88b3: Pull complete
3d06cf2f1b5e: Downloading
edd0da9e3091: Download complete
eb7768aae14e: Download complete
e2780f585e0f: Download complete
e5ed720afeba: Download complete
d9e134700cfc: Download complete
e4804b33d02a: Download complete
b9df0c24315e: Download complete
49fdae8eaa20: Download complete
1aea3d9a32e6: Download complete
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Get https://registry-1.docker.io/v2/library/tomcat/manifests/8.0:
unauthorized: incorrect username or password.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.
在 下载docker镜像时unauthorized: incorrect username or password. 这是个很明显错误。我们没有下载镜像前没有登录
我们在下载docker官网的镜像时,需要登录我们docker的账户 如果没有账户可以去docker官网注册
我们可以用docker login命令,登录我们的docker,username填写我们的用户名( 用户名就是下图docker官网中的用户名)
PS C:\Users\xxx> 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 (xxxxxxx@163.com): xxxxxx
Password:
Login Succeeded
登录成功后,就可以拉取镜像了。