docker file to run automation test in JS files

2019-08-21 09:29发布

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条回答
小情绪 Triste *
2楼-- · 2019-08-21 09:59

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

查看更多
登录 后发表回答