Docker support intellij - intellij-idea

I was running docker inside a VM and was using the Docker integration plugin in IntelliJ (Intellij on my host machine, not vm). I upgraded my OS and now I am able to run my Docker containers directly on my host machine. I can't find how to use the Docker plugin anymore. How can I use the plugin when Docker is running natively? When it was running on a VM, I would go under Settings -> Build, Execution, Deployment -> Clouds and would enter MY_VM_IP:2376 under API URL, but now I have no idea what to put there (or even if that's where I configure it). I tried 127.0.0.1:2376 and also tried 192.168.99.100:2376. Both are giving me 'Network is unreachable' error.

I found how:
I edited the /etc/sysconfig/docker file and added "-H 0.0.0.0:2376 -H unix:///var/run/docker.sock" to OPTIONS. Then I put 127.0.0.1:2376 as API URL under Settings -> Build, Execution, Deployment -> Clouds and it's working.

Related

Building Docker images with GitLab CI/CD on existing git-runner

I have to build and push docker image via gitlab-ci. I have gone through the official document.
https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
I want to adopt shell method but my issue is I already had a working gitrunner on my server machine. So what the procedure for it. If I tried to re-register the git runner on the same machine. will it impact the old one?
Thanks in advance.
Assuming that you installed gitlab-runner as a system service and not inside a container, you can easily register another shell runner on your server using the command gitlab-ci-multi-runner register.
This is indirectly confirmed by the advanced configuration documentation, which states that the config.toml of the gitlab-runner service may contain multiple [[runner]] sections.
Note: To allow the shell runner to build docker images, you will need to add the gitlab-runner user to the docker group, e.g.:
sudo gpasswd --add gitlab-runner docker

how to upload a file to selenium test running in docker

Am running my selenium java tests in Docker's chrome container installed in my windows system.
Tests to upload will pass if i run tests in windows - chrome, but failing with error path is not absolute: D:\xyz.csv if i run same tests in docker.
Am pushing my tests on chrome node in docker.
Normal selenium tests work in docker, but upload doesn't.
Please suggest on how to copy this file inside container to give that path for upload tests..
Thanks
That is because Chrome would look for that path in the system where it. But the container is a linux based system and the file paths are not like this.
So you need to share volume while launching the chrome container
docker run -v localfolder:containerfolder
and in your test you need to use the contaienrfolder path and not the localfolder path
I got the solution of this problem long time back.
Use below command to copy the files from windows/Linux system to Chrome container running in docker's say 'tmp' folder , this path can be later referenced in selenium tests running in Docker.
"docker cp D:\file.csv docker_chrome_1:/tmp/"
This above command can be run once Docker's Chrome container is up and running in Windows/Linux machine.

View files in docker container

I created a docker container. I can ssh into the docker container. How can I view files in my docker container with a GUI (specifically the WebStorm IDE)?
I'm running a MAC on OSX Yosemite 10.10.5.
The usual pattern is to mount your source code into the container as a volume. Your IDE can work with the files on your host machine and the processes running in the container can see the files. docs
There might be a way to set up remote file access with WebStorm, but I'd recommend trying the other approach first.
docker run daemon -v /mycodedir:/mydockerdir {libraryname}/{imagename} if you mount your work directory and map it to the directory running files in the container you will be able to edit and see them in Web Storm.

Running Jenkins Jobs on Windows Virtual Machine

Im trying to setup Jenkins to run tests on a Virtual Machine but im not to sure how to proceed.
What id like to be able to do is to get Jenkins to build the environment on the vm and then have Jenkins execute the test scripts on the vm environment. After the tests have passed/failed id then like Jenkins to clean the database and pull down the virtual environment.
Server box - Windows 7
Virtaul Machine - VMWare
So what im looking for is some information or tutorials on how to implement the above. It would also be helpful if you could recommend what Jenkins plugins I can use to implement the above or if you want to go above and beyond can you outline the steps needed to achieve the above.
Any help would be appreciated.
I'm doing just that in my environment using the vSphere Cloud Plugin. Here's a basic step-by-step guide:
Install the plugin
Configure your ESX/ESXi server as a new "vSphere Cloud"
Create a new Jenkins node, of type "Slave virtual computer running under vSphere Cloud" (which becomes available after Installing the plugin).
When configuring the new node, optionally specify a snapshot name. This will revert the VM to this snapshot when the node launches.
Use the node in a pipeline script: node("node-name-or-label") { ...your code here... }
I use the method above with about 10 Windows nodes, reverting each to a "Clean" snapshot to start each build with a known state.

Jenkins running selenium tests without opening browser

I browsed a lot on this topic. There are different variations of this question or no answer to fix my issue. Any help is appreciated.
I have installed firefox on my VM as root in /usr/bin/firefox.
I downloaded the maven project to run selenium tests, and run it
manually on my VM using mvn clean install command. This opens the
browser and also successfully runs the test.
Now I run Jenkins as myself ( JAVA_HOME is /usr/java/latest and started the service as
nohup java -jar jenkins.war --httpPort=-1 --httpsPort=8082; version
is 1.522).
Create a new freestyle s/w project; Configure the job
to download the maven project and invoke maven target 'clean
install';
When I run the job, I can see the steps in the console
output but the browser is not opening. It also locks up my AD account.
Why is this happening? What is the fix?
nohup runs Jenkins in the background (http://en.wikipedia.org/wiki/Nohup), in which case according to this post Jenkins will start the browser in the background as well.
Try starting jenkins without nohup so that it runs in the foreground (java -jar jenkins.war --httpPort=-1 --httpsPort=8082).
Or you can start Jenkins as a daemon (this Jenkins Wiki page contains an example of init script). When Jenkins is started as daemon, the browser started by its job is visible.