Open the terminal and build the project with maven:
mvn package
Build a docker image and run it.
docker build -t tomcat8-jersey2-weld2 .
docker run --rm -p 8080:8080 tomcat8-jersey2-weld2
That's it!!! After Tomcat initialization, open a url: http://localhost:8080/foo/bar