Can't connect to WebDriver. Error: connect ECONNREFUSED 127.0.0.1:4444 (codeceptjs ) - codeceptjs

I've done configuration by using https://codecept.io/quickstart this tutorial and try to run npx codeceptjs run --steps this command , and then I get this issue . I use for this ubuntu wsl system on windows 10 . Why do this happens ? If you need more information , pls let me know !

Looks like you try to use the WebDriver helper.
This needs a selenium server running.
The easiest is to install it via npx selenium-standalone install and then to run it via npx selenium-standalone start. In a new command line window run npx codeceptjs run --steps again.

Just stand up a Selenium server running on port 4444.
e.g.,
docker run -d -p 4444:4444 --name=selenium --rm -v /dev/shm:/dev/shm selenium/standalone-chrome
More info can be found here: https://codecept.io/quickstart-webdriver

Related

Is there a way to install laravel 9 on your machine with out having php 8 on your machine?

I tried creating larvel 9 project using composer. Since my machine don't have php 8 installed on it. While running command composer create-project laravel/laravel --prefer-dist myapp, a laravel 8 project is created.
While running composer create-project laravel/laravel:^9.0 --prefer-dist myapp it gives me error as
Could not find package laravel/laravel with version ^9.0 in a version installable using your PHP version, PHP extensions and Composer version. .
So, my question is, i dont want to install php8 on my machine rather i want to create a laravel 9 project using docker but i seems to get lost on it.
I did tried creating project using following command:
composer create-project laravel/laravel=9.* --ignore-platform-req your-project-name --prefer-dist
It gives me the same error as above Could not find package laravel/laravel with version ^9.0 in a version installable using your PHP version, PHP extensions and Composer version.
You can create a docker container with PHP already installed in it and map it to your local drive:
docker run -it --rm -v $(pwd):/work -w /work php:alpine3.14
That works in bash. If you're in windows, replace the $(pwd) bit with the directory you want to create the project in.
This should give you a shell that allows you to use php without having it on your machine. You can try your project init there and it'll create the files on your local drive. You can exit by typing ctrl+d or typing exit.
If this image doesn't have what you want, you can try this one:
docker run -it --rm -v $(pwd):/work -w /work composer
Which already has composer installed.
For a full run, taking care of file ownership and with the correct instructions to composer, you'd want to run this:
docker run -it --rm -v $(pwd):/work -w /work -u 1000:1000 composer:latest create-project laravel/laravel=9.* --ignore-platform-reqs --no-scripts /work

Why does uWSGI in Docker fail from CMD but run from command line?

I have the following Dockerfile:
FROM alpine
RUN apk add uwsgi
CMD ["/usr/sbin/uwsgi", "--socket 127.0.0.1:8000"]
Running it, with docker run <image name>, results in the following error:
/usr/sbin/uwsgi: unrecognized option: socket 127.0.0.1:8000
getopt_long() error
However, running docker run <image name> /usr/sbin/uwsgi --socket 127.0.0.1:8000
works fine. According to the docs, using CMD like this "does not invoke a command shell. This means that normal shell processing does not "happen." I am not sure whether this is the culprit.
How do I get uWSGI to work with CMD whilst still using the alpine version?
--socket and 127.0.0.1:8000 is a different options.
You have to specify:
CMD ["/usr/sbin/uwsgi", "--socket", "127.0.0.1:8000"]

Unable to connect to published Docker port on OS X

I'm trying to run a simple Node.js/Express web app in a Docker (17.06) container on OS X (latest update 10.12.5). I'm unable to connect to the app at localhost:3000 and am unable to figure out what's wrong. I have also tried to connect to the VM's IP address found by running ip addr | grep global in its console to no avail.
My app is actually just the framework JetBrains Webstorm creates when creating a new project of type 'Node.js Express App'. Note that I'm able to run this app on my host system via npm start and successfully connect to it at localhost:3000.
I then built a Docker image like so:
docker build -t joonas/meancopy .
Run it:
docker run -it -v `pwd`:/home/dev/src --name meancopy joonas/meancopy -p 3000:3000
And after being thrown in the VM's shell, I run npm start and get the following:
[dev#c24d24f58f1d:~/src$ npm start
npm info it worked if it ends with ok
npm info using npm#5.0.3
npm info using node#v8.1.2
npm info lifecycle npmtest#0.0.0~prestart: npmtest#0.0.0
npm info lifecycle npmtest#0.0.0~start: npmtest#0.0.0
> npmtest#0.0.0 start /home/dev/src
> node ./bin/www
The output is the same as when run on the host expect for the "npm info" lines in the beginning. However, I'm unable to connect to this server at localhost:3000.
I've also tried running the image with --expose=3000 and --net="host" because I found those when searching for solutions online, but they don't help (and to my understanding shouldn't even be necessary here).
Any help or debugging ideas are greatly appreciated!
your docker run command is bad
docker run -it -v `pwd`:/home/dev/src --name meancopy joonas/meancopy -p 3000:3000
the way you have this written, the container is going to try and execute -p 3000:3000 as the container's process instance. you need to put the -p parameter before the the name of the image.
docker run -it -v `pwd`:/home/dev/src --name meancopy -p 3000:3000 joonas/meancopy
Now docker will run the command defined in your Dockerfile - which will probably be the node.js app, as expected.

How to install telnet in Docker for Windows 10

When I run telnet command in Docker it does not run.
Could you please tell me how to install telnet in Docker for Windows?
Old question I know but you can install telnet on docker for windows with the following in your dockerfile
RUN powershell -Command Add-WindowsFeature "telnet-client"
There is a docker image for it:
docker run mikesplain/telnet <host> <port>
If you are trying to telnet into your container to gain access to it, that isn't how you would want to connect. Docker provides that functionality.
Connect into a running container - Docs:
docker exec -it <container name> bash
$ root#665b4a1e17b6:/#
Start a container from image, and connect to it - Docs:
docker run -it <image name> bash
$ root#665b4a1e17b6:/#
Note: If it is an Alpine based image, it may not have Bash installed. In that case using sh instead of bash in your commands should work.
If you were using Kubernetes, you could install telnet in k8s by running:
apk update
apk add busybox-extras
telnet 10.0.180.37 11211
The following command will work if you want to install Telnet client in a running Windows Docker container. Just run this command in your container's terminal:
dism /online /Enable-Feature /FeatureName:TelnetClient

Why is Docker Tomcat failing to start?

I am trying to build a Tomcat image from a Dockerfile. This is what my Dockerfile looks like:
FROM dockerfile/java
RUN sudo apt-get update
RUN sudo apt-get install tomcat7
EXPOSE 8086
CMD sudo service tomcat7 start && tail -f /var/log/tomcat7/catalina.out.
but when I build an image from this and run the image with
$ docker run tomcat7-test
it gives the following:
Starting Tomcat servlet engine tomcat7 …fail!
I don’t know what is causing the problem. How can I check the logs of this Docker Tomcat? Can anybody tell me what commands I should use in the Dockerfile to run Tomcat?
There is an official Tomcat image you can use. There are links to the Dockerfiles there to checkout and install Tomcat.
If you want to inspect what is going on when you build your dockerfile, just perform the same steps (apt-getting tomcat7 and starting the service) manually after starting an interactive shell inside the dockerfile/java container with this command:
docker -it dockerfile/java bash
There you will be able to check the logs and see what could be going on.
I did install tomcat server in the docker container instead of using the official Tomcat image.
When I start the server I get the fail response but was curl the tomcat server index page.
Also instead of exiting the container, if you detach from it back to your terminal by typing:
ctrl-p then ctrl-q (source)
You can access your webapps from browser using the below URL:
http://<< boot2docker_ip >>:8080
Try running the image with following command
docker run -dt --cap-add SYS_PTRACE -p 8082:8080 tomcat7-test

Resources