markhobson / docker-maven-chrome

Docker image for Java automated UI tests.
https://hub.docker.com/r/markhobson/maven-chrome/
Apache License 2.0
97 stars 81 forks source link

Unable to run the docker image #21

Closed sayom88 closed 4 years ago

sayom88 commented 4 years ago

Hello, I am running the commands mentioned in run.sh, but I am unable to run the docker image and getting an error as belows. Can you please suggest what needs to be done to fix this issues. Sayoms-MacBook-Air:~ sayomghosh$ docker pull markhobson/maven-chrome Using default tag: latest latest: Pulling from markhobson/maven-chrome Digest: sha256:b910cf222dca295bfb6d641eff103d5ec509e5a0ce54942b9df43e9337b3ea77 Status: Image is up to date for markhobson/maven-chrome:latest docker.io/markhobson/maven-chrome:latest Sayoms-MacBook-Air:~ sayomghosh$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE markhobson/maven-chrome latest 938098fa885d 3 months ago 1.08GB Sayoms-MacBook-Air:~ sayomghosh$ docker run --rm -it -v "$PWD":/usr/src -w /usr/src markhobson/maven-chrome mvn clean verify [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.200 s [INFO] Finished at: 2020-05-23T06:36:50Z [INFO] ------------------------------------------------------------------------ [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/usr/src). Please verify you invoked Maven from the correct directory. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException Sayoms-MacBook-Air:~ sayomghosh$

markhobson commented 4 years ago

Hi, the run.sh script is supposed to be run within the demo directory - it runs the demo project using the Docker image. The error you're getting is because the docker run mvn command expects the demo/pom.xml file to be in the current directory.

Would it be clearer if the README detailed the commands to run the demo?

sayom88 commented 4 years ago

Hello, Okie. I am having one doubt here. If I want to make the docker image to run from anywhere and now just from within the demo directory only, then how can I do so please? Yes it should clearer if the README is detailed with the commands to run.

markhobson commented 4 years ago

I've updated the README with the commands to run the demo project.

I think there's a misunderstanding about this demo project. It is a simple example showing how to run a Maven project within this Docker image. The run.sh script is only intended to run this demo project.

To use this Docker image outside of the demo you will typically have your own Maven project. You can then set this up in a similar way to the demo project if that matches your use-case. Does that make sense?

sayom88 commented 4 years ago

Hello, I am sharing my demo selenium maven poc project where I want to create a docker image which I can run from anywhere. Can you please suggest what changes I need to make in the dockerfile (or anywhere) so that I can run the docker image from anywhere please. Selenium_Docker_Maven.zip

markhobson commented 4 years ago

This is really out-of-scope for this project, but a few comments: