I am new to docker and I am trying to build a docker file for my selenium code (uses gradle)to send it over to devOps for integrating in pipeline . I am able to build the image but when I try running the image i get the following error
"File name too long
/code/executables/chromedriver.exe: 4: /code/executables/chromedriver.exe: Syntax error: "(" unexpected" . Please find the docker file and main class code below
The same code is working fine when i run outside of docker env .
executables is a project folder under which chromedriver.exe is placed
docker file code :
FROM selenium/standalone-chrome
FROM gradle
ADD . /code
WORKDIR /code
CMD gradle build --info
Main java class code where the error i think is originating from :
ChromeOptions chromeOptions = new ChromeOptions();
dc = DesiredCapabilities.chrome();
dc.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
System.setProperty("webdriver.chrome.driver","./executables/chromedriver.exe");
Drivers.driver = new ChromeDriver(dc);
Drivers.driver.get("https://www.facebook.com");
Related
I'm trying to run docker desktop on my
ubuntu-22.04 but when I run any docker command in the terminal it gives the following error:
exec: "com.docker.cli": executable file not found in $PATH
Current PATH : /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/local/bin
I noticed that my com.docker.cli file is colored red in the folder: usr/local/bin
see my image:
I also noticed that there is no docker directory in /usr/bin
Can anyone help me to resolve this?
I've been trying to initiate my pipeline on gitlab CI/CD for a demo project. I've installed gitlab-runner in my windows local machine and gave the executor type as "Shell". And I've successfully integrated the gitlab-runner with my gitlab project. But whenever I pushed any changes to repo, the pipeline started and end up in "pshw" not found in %PATH error.
This is error which I'm getting every time
ERROR: Job failed (system failure): prepare environment: failed to start process: exec: "pwsh": executable file not found in %PATH%. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information
Can anyone help me to resolve this issue and explain what and why I'm getting this error.
Thanks in advance
When choosing the shell option, the gitlab runner installer uses pwsh as the executor. It generates a config.toml that looks like
[[runners]]
name = "some name"
url = "http://someurl.com/"
token = "some-token"
executor = "shell"
shell = "pwsh"
The problem is that pwsh isn't a valid windows command (on my installs). Changing pwsh to powershell and restarting gitlab-runner service fixed the problem for me.
Go to the installation directory of GitLab Runner e.g. C:\Automation\GitLab-Runner. Here you will see config.toml file, open with notepad and replace "pwsh" with "powershell" as below:
From:
[[runners]]
name = "PT-Runner"
url = "https://gitlab.com"
executor = "shell"
shell = **"pwsh"**
To:
[[runners]]
name = "PT-Runner"
url = "https://gitlab.com"
executor = "shell"
shell = **"powershell"**
Currently I'm trying to build container serving VueJS application via Cloud Native Buildpacks.
I already have working Docker file that builds VueJS in production mode and then copy results to nginx image, but I would like to try to use CNB.
So I just have created empty VueJS project for test via vue create vue-tutorial and trying to do with CNB somehting like described there https://cli.vuejs.org/guide/deployment.html#heroku but using CNB.
Does anyone know working recipe how to do that with CNB?
P.S. Currently I'm trying to build that with
pack build spa --path . \ SIGINT(2) ↵ 17:22:41
--buildpack gcr.io/paketo-buildpacks/nodejs \
--buildpack gcr.io/paketo-buildpacks/nginx
but getting next error (and I'm not sure that I'm on right way):
===> DETECTING
ERROR: No buildpack groups passed detection.
ERROR: Please check that you are running against the correct path.
ERROR: failed to detect: no buildpacks participating
ERROR: failed to build: executing lifecycle: failed with status code: 100
UPD
My current dockerfile
# build stage
FROM node:lts-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# production stage
FROM nginx:1.19-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
We chatted about this in Slack, but I wanted to capture it here too:
pack build --buildpack heroku/nodejs --buildpack https://cnb-shim.herokuapp.com/v1/heroku-community/static yourimage
This command may do what you want. The static buildpack used in that example is not yet converted to a cloud native buildpack, but the shim may allow you to build a workable artifact. Then run your image with something like docker run -it -e PORT=5000 -p 5000:5000 yourimagename
I am trying to get selenium side runner to run some tests using docker, to include in our CI.
I am able to run the tests locally in my machine by running:
selenium-side-runner C:\path-to-tests\tests-selenium.side
This is windows host.
I am trying to do the same using docker locally, so afterwards I will migrate this to our Teamcity.
First I am running the selenium server container:
docker run -d -p 4444:4444 --name chromedriver selenium/standalone-chrome:3.4.0
Afterwards I run the selenium side runner container:
docker run -v C:\path-to-tests:/sides --link chromedriver:chromedriver nixel2007/docker-selenium-side-runner
I have to link the containers otherwise I get an error saying that the container can't connect to chromedriver:4444
I also have to mount the volume where my tests are.
When I do this and run, I get the following error:
Test suite failed to run
WebDriverError: Unable to parse new session response
What am I missing here?
UPDATE:
I also tried different versions of the selenium/standalone-chrome container, selenium/standalone-chrome:3.4.0, selenium/standalone-chrome:3.141.59-xenon and selenium/standalone-chrome:latest
All fail with different errors.
SECOND UPDATE:
I have been able to get the tests to run, both locally and in teamcity. One of the issues that I am facing right now is that docker-compose seems to hang. Not sure if this is container related, or docker-compose related.
When I run the tests, the selenium side runner container exits with code 1 and I do not get back to the host console prompt, it stays forever waiting for something to happen.
The error is this:
selenium_selenium-side-runner_1 exited with code 1
I have gotten the docker-compose file from here:
https://github.com/nixel2007/docker-selenium-side-runner/blob/master/docker-compose.yml
Any clues on what I might be missing?
i am trying to set up gitlab runner for a project, and when i try to run the build i am getting an 403 error.
Where can i check the build logs other than doing systemctl status gitlab-runner?
git-lab-runner Version: 9.5.1
build error:
Running with gitlab-ci-multi-runner 9.5.1 (96b34cc)
on ci (3aa5e67d)
Using Docker executor with image docker.xxx.com/terraform:latest ...
Using docker image sha256:134722953932eb772ab67a8b6e865aae2da7fe6ba3f09e757ea09e0d416ec203 for predefined container...
Pulling docker image docker.xxx.com/terraform:latest ...
Using docker image docker.xxx.com/terraform:latest ID=sha256:fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx for build container...
Running on runner-3aa5e67d-project-184-concurrent-0 via ip-10-xx-xx-xx...
Cloning repository...
Cloning into '/builds/bi/abc'...
fatal: unable to access 'https://gitlab.xxxx.com/folder/abc.git/': The requested URL returned error: 403
ERROR: Job failed: exit code 1
runner config:
concurrent = 1
check_interval = 0
[[runners]]
name = "ci"
url = "http://gitlab.xxx.com"
token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
executor = "docker"
[runners.docker]
tls_verify = false
image = "docker.xxx.com/terraform:latest"
privileged = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.cache]
I had configured gitlab runner to a different project but it did not ask me to add the user to the members, how can i troubleshoot this error, i believe its an authentication error.