无法在本地找到Docker映像 [英] Unable to find docker image locally
问题描述
我正在关注这篇文章-参考代码在 GitHub 上.我已经在本地克隆了存储库.
I was following this post - the reference code is on GitHub. I have cloned the repository on my local.
该项目内部有一个react应用.我正在尝试在
The project has got a react app inside it. I'm trying to run it on my local following step 7 on the same post:
docker run -p 8080:80 shakyshane/cra-docker
这将返回:
Unable to find image 'shakyshane/cra-docker:latest' locally
docker: Error response from daemon: pull access denied for shakyshane/cra-docker, repository does not exist or may require 'docker login'.
See 'docker run --help'.
我尝试再次登录docker,但由于它属于 @shakyShane ,因此我无法访问它.
I tried login to docker again but looks like since it belongs to @shakyShane I cannot access it.
我也曾愚蠢地尝试过npm start
,但这不是在节点上运行的简单React应用-它在容器中,容器不受npm
I idiotically tried npm start
too but it's not a simple react app running on node - it's in the container and containers are not controlled by npm
看起来像docker pull shakyshane/cra-docker:latest
会抛出以下内容:
Looks like docker pull shakyshane/cra-docker:latest
throws this:
Error response from daemon: pull access denied for shakyshane/cra-docker, repository does not exist or may require 'docker login'
所以问题是我如何在本地Mac机器上运行此docker映像?
So the question is how do I run this docker image on my local mac machine?
推荐答案
这是反逻辑的,但仍然可以共享,因此像我这样的未来人不会卡住
Well this is anti-logical but still sharing so future people like me don't get stuck
So the problem was that I was trying to run a docker image which doesn't exist.
我需要构建图像:
docker build . -t xameeramir/cra-docker
然后运行它:
docker run -p 8080:80 xameeramir/cra-docker
这篇关于无法在本地找到Docker映像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!