docker file to run automation test in JS files

爷,独闯天下 提交于 2019-12-11 14:59:15

问题


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

while running with $ docker run -p 4000:80 lamgadekamal/dockertest

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?


回答1:


I suspect that you need to build your image first, since the image cannot be found.

Run this command from the same directory where your Dockerfile is located. This will build the image.

docker build -t lamgadekamal/dockertest .

You can then verify that the image exists by running docker images

EDIT: 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



来源:https://stackoverflow.com/questions/47983562/docker-file-to-run-automation-test-in-js-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!