greenframe-cli icon indicating copy to clipboard operation
greenframe-cli copied to clipboard

Build a docker image with greenframe-cli

Open vpeltot opened this issue 2 years ago • 5 comments

Closes #18

vpeltot avatar Nov 14 '22 07:11 vpeltot

Awesome! Your PR is in Draft, what's left to finish it?

fzaninotto avatar Nov 14 '22 16:11 fzaninotto

I just pushed a new commit with

  • Update README file to add a "docker" section
  • Change the greenframe-cli image name to just greenframe to be consistent with the command line. I think it's better to have $ docker run marmelab/greenframe analyze ... istead of $ docker run marmelab/greenframe-cli analyze ...
  • Add an entrypoint & default --version command

vpeltot avatar Nov 17 '22 08:11 vpeltot

@fzaninotto Can you set the environment variables DOCKER_REGISTRY_USER and DOCKER_REGISTRY_PASS values with your docker hub credentials?

vpeltot avatar Nov 17 '22 08:11 vpeltot

Hello Vincent,

I've checked out locally and tried to run a greenframe analyze using the provided Dockerfile:

# from project root
docker build -t greenframe-docker-in-docker-test .
docker run -v $(pwd)/:/app greenframe-docker-in-docker-test analyze -C ./.greenframe.e2e.yml

I'm getting an error about being unable to connect to the Docker daemon:

❌ main scenario failed
This scenario fail during the execution:
Command failed: docker create --tty --name greenframe-runner --rm -e HOSTIP=172.17.0.3 --add-host localhost:172.17.0.3  mcr.microsoft.com/playwright:v1.28.1-focal
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

I thought this was dind based but now realize it might be dood (Docker outside of Docker), do we have to map the docker sock from host to container for it to work?

If yes, we need to document it, and we could use an alpine based image so that the final image is lighter, I worked on a dood alpine image so it might come handy.

floo51 avatar Dec 07 '22 13:12 floo51

Hello. First of all I would like to thank you for this project.

Juste my 2 cents here. We have created a small and simple Docker image in order to run greenframe-cli : https://github.com/acseo/docker-greenframe-cli

You cans use it to test a remote or a local website :

$ docker run -it -v /var/run/docker.sock:/var/run/docker.sock acseo/greenframe-cli \ 
    greenframe analyze https://www.acseo.fr
$ docker run -it \
    -e "DEBUG=*" \
    --network="host" \
    -v $(pwd)/greeframe.yml:/app/greenframe.yml \
    -v $(pwd)/scenario.js:/app/scenario.js \
    -v /var/run/docker.sock:/var/run/docker.sock \
    acseo/greenframe-cli greenframe analyze -C /app/greenframe.yml http://my-app.local /app/greenframe.js

Maybe it will be useful for someone 😃

npotier avatar Jan 04 '23 02:01 npotier