I want to create a docker layout to eliminate the number of commands needed to run my tests. My goal is to run the ONE command and it will launch my containers and run my tests. This is my first time you create a docker file, so please be patient. The docker-compose.file is located next to two other dock files. Below are the dockers that I initiated, but I can't even create images. I tried to indicate the purchase path with the addition of "volumes: ...", but it still does not work.
services:
headless-chrome:
build: ./Dockerfile-headless-chrome
dev-server:
build: ./Dockerfile
Traceback (most recent call last):
File "/usr/local/bin/docker-compose", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/compose/cli/main.py", line 68, in main
command()
File "/usr/local/lib/python2.7/site-packages/compose/cli/main.py", line 118, in perform_command
handler(command, command_options)
File "/usr/local/lib/python2.7/site-packages/compose/cli/main.py", line 926, in up
scale_override=parse_scale_args(options['--scale']),
File "/usr/local/lib/python2.7/site-packages/compose/project.py", line 401, in up
svc.ensure_image_exists(do_build=do_build)
File "/usr/local/lib/python2.7/site-packages/compose/service.py", line 311, in ensure_image_exists
self.build()
File "/usr/local/lib/python2.7/site-packages/compose/service.py", line 888, in build
buildargs=build_args
File "/usr/local/lib/python2.7/site-packages/docker/api/build.py", line 137, in build
raise TypeError("You must specify a directory to build in path")
TypeError: You must specify a directory to build in path
version: "3"
To run the tests, I use this: Shell 1:
$ SCHEME=http ENV=stage DOCKER_DEV_ENTRYPOINT='"npm run dev-server"' make docker-dev
When this is done, I need to run below in a new shell (shell 2):
$ docker build -t headless-chrome -f Dockerfile-headless-chrome .
$ docker run -it --rm --net=host --cap-add=SYS_ADMIN headless-chrome /bin/bash
Then when Im inside the Im container works:
$ npm run selenium-docker
$ npm run uat