问题描述
我正在尝试创建一个docker文件来为基于Java脚本的项目运行硒测试.以下是到目前为止的我的docker文件:
I am trying to create a docker file to run selenium tests for a java script based project. Below is my docker file so far:
#base image
FROM selenium/standalone-chrome
#access to the project within docker container - Bundle app source
COPY ./seleniumTest/project /app
# Install Node.js
RUN sudo apt-get update
RUN sudo apt-get install --yes curl
RUN curl --silent --location https://deb.nodesource.com/setup_8.x | sudo bash -
#binding
EXPOSE 8080
#Define runtime
ENTRYPOINT /app/login.test.js
使用$ docker run -p 4000:80 lamgadekamal/dockertest
返回:无法在本地找到镜像'lamkam/dockertest:latest'泊坞窗:来自守护程序的错误响应:找不到lamkam/dockertest:latest的清单.无法弄清楚我为什么得到这个?
returns: Unable to find image 'lamkam/dockertest:latest' locally docker: Error response from daemon: manifest for lamkam/dockertest:latest not found. Could not figure out why am I getting this?
推荐答案
我怀疑您首先需要构建映像,因为找不到该映像.
I suspect that you need to build your image first, since the image cannot be found.
在Dockerfile
所在的目录中运行此命令.这将生成图像.
Run this command from the same directory where your Dockerfile
is located. This will build the image.
docker build -t lamgadekamal/dockertest .
然后您可以通过运行docker images
编辑:再次查看此内容后,您似乎正在尝试运行错误的图像.您正在尝试运行lamgadekamal/dockertest
,但是是否使用标签lamkam/dockertest
构建了映像?好像您有错字.我建议运行docker images
以确切了解其中的内容,但是很可能需要运行lamkam/dockertest
.
After looking at this again, it appears that you are trying to run the wrong image. You are trying to run lamgadekamal/dockertest
, but you built the image with the tag lamkam/dockertest
? Seems like you have a typo. I would suggest running docker images
to see exactly what is there, but in all likelihood, you need to run lamkam/dockertest
.
docker run -p 4000:80 lamkam/dockertest
这篇关于docker文件以在JS文件中运行自动化测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!