docker under macOS: cannot run

docker under macOS: cannot run

by Murray Eisenberg -
Number of replies: 0
Under macOS 10.13.6 I installed current stable version of Docker, opened, signed in there, created ~/Documents/webwork_docker, cd'd to that folder, and then in Terminal attempted to execute:

docker run -d -p 80:80 --name webserver nginx

This gave error:

Unable to find image 'nginx:latest' locally

docker: Error response from daemon: Get unauthorized: incorrect username or password.

See 'docker run --help'.

In fact, I get a similar error just trying to execute:

docker run hello-world

Any idea how to fix this?