GithubHelp home page GithubHelp logo

endurantdevs / sonarqube-mysql-windows-docker Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 5.0 448 KB

SonarQube with MySQL and Java in windows container for easy run

Home Page: https://hub.docker.com/r/dnikolayev/sonarqube-mysql-windows/

License: MIT License

Batchfile 39.74% PowerShell 7.32% Dockerfile 52.94%
sonarqube docker windows docker-windows mysql nanoserver windowsservercore

sonarqube-mysql-windows-docker's Introduction

Update

Latest versions updated to SonarQube LTS: v6.7.6, Latest: 7.6

Basic Info

Windows container with SonarQube, Java, and MySQL as Database for SonarQube. It provides an easy way to run of SonarQube with sharing MySQL and SonarQube Extensions folders for more comfortable work with SonarQube.

SonarQube® software (previously called Sonar) is an open source quality management platform, dedicated to continuously analyze and measure technical quality, from project portfolio to method.

Containers are based on Microsoft Nanoserver and OpenJDK. Nanoserver was used to save your resources. However, for special purposes there are versions based on Microsoft Windowsservercore.

MySQL version used: 5.7.16

Dockerfiles for builds are shared in GitHub and built images are available on DockerHub. Files are fully windows-native, so you can customize them for your needs if you don't like a version from DockerHub.

Containers have two shared Volumes. One for MySQL data and the second one is for "Extensions" folder for SonarQube. MySQL data Volume is needed to not lose your SonarQube history after restarting the container. Extensions Volume is need to give ability to update plugins to newer versions for SonarQube.

I recommend assigning extensions folder to a useful path on your host-machine. This will make you easier to add custom plugins for SonarQube like Community C++ Plugin or any other one.

Available versions

Tag SonarQube Version Base Container Size Source
:latest 7.6 Latest nanoserver 3.46 GB GitHub
:lts 6.7.6 LTS nanoserver 3.41 GB GitHub
:latest-windowsservercore 7.6 Latest windowsservercore 12.8 GB GitHub
:lts-windowsservercore 6.7.6 LTS windowsservercore 12.7 GB GitHub

Usage (Command Line)

docker pull dnikolayev/sonarqube-mysql-windows

Docker Pull

Note: On windows 10 default memory allocation is different to windows 2016 server. Please don't forget to add --memory 2g to the next command Discussion on GitHub

docker run --name sonar  -it -p 9000:9000  `
-v C:/data/mysql:C:/MySQL/data `
-v C:/data/extensions:C:/sonarqube/extensions `
dnikolayev/sonarqube-mysql-windows:latest

Running container

To check configuration of the run container:

docker inspect sonar

Usage (Visual)

  • Let's try to use Kitematic to run SonarQube container. Kinematic main screen

  • Find this container via my nickname dnikolayev Find SonarQube Windows container

  • Select the tag (Version) you want to use. To go into this menu - please click on ". . ." button Select the version you need

  • Don't forget to go to "Settings" to configure local folders, network and other settings. Than Run the container. Select local directories for Volumes

  • Once container loads - you will have SonarQube working. Just add extensions you need for you work. After loading container - SonarQube is getting available

Notes

By default, SonarQube starts via Java Service Wrapper. This container doesn't use it and runs SonarQube via jar-file directly. This was done because of the fact that nanoserver allows you to run only 64-bit applications. However, 64-bit version of java-wrapper uses some 32-bit libraries?! So, on nanoserver it just doesn't start without throwing any errors. Thanks to NanoServerApiScan utility. It gave me ability to see the source of the problem :)

64-bit Java Wrapper doesn't work on Nanoserver because of 32-bit dependencies

Good luck with your code quality checks!

sonarqube-mysql-windows-docker's People

Contributors

dnikolayev avatar haranadhpanaka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sonarqube-mysql-windows-docker's Issues

MySql PacketTooBigException

The default max_allowed_packet config value of MySql was not enough for me, so when I tried to upload an analysis, I've faced the following exception:

com.mysql.jdbc.PacketTooBigException: Packet for query is too large (6212360 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.

The following answer helped me:
https://stackoverflow.com/questions/14592351/packettoobigexception-when-running-a-sonar-analysis
(both MySql and the sonar server should be restarted)

There was another step, as the my.ini file was not created in the image, so I had to create my.ini from my-default.ini and added the following line:

max_allowed_packet=256M

"Error occurred during inititalization of VM" when container is starting up

Hi.
Here's the error output I get when I start the container. I followed the instructions in the readme but it doesn't like something somewhere.

"Checking Folder: 'C:\MySQL\data\*.*'"
'Data exists, trying to start with your data'
The service already exists!
The current server installed: C:\MySQL\bin\mysqld.exe MySQL
2017.08.23 14:26:07 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube\temp
2017.08.23 14:26:07 INFO  app[][o.s.a.p.JavaProcessLauncherImpl] Launch process[es]: C:\ojdkbuild\jre\bin\java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djna.nosys=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=C:\sonarqube\temp -cp ./lib/common/*;./lib/search/* org.sonar.search.SearchServer C:\sonarqube\temp\sq-process8553778366576639208properties
2017.08.23 14:26:08 INFO  es[][o.s.p.ProcessEntryPoint] Starting es
2017.08.23 14:26:08 INFO  es[][o.s.s.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2017.08.23 14:26:08 INFO  es[][o.elasticsearch.node] [sonarqube] version[2.4.4], pid[1852], build[fcbb46d/2017-01-03T11:33:16Z]
2017.08.23 14:26:08 INFO  es[][o.elasticsearch.node] [sonarqube] initializing ...
2017.08.23 14:26:08 INFO  es[][o.e.plugins] [sonarqube] modules [], plugins [], sites []
2017.08.23 14:26:08 INFO  es[][o.elasticsearch.env] [sonarqube] using [1] data paths, mounts [[(C:)]], net usable_space [19.7gb], net total_space [19.8gb], spins? [unknown], types [NTFS]
2017.08.23 14:26:08 INFO  es[][o.elasticsearch.env] [sonarqube] heap size [1007.3mb], compressed ordinary object pointers [true]
2017.08.23 14:26:11 INFO  es[][o.elasticsearch.node] [sonarqube] initialized
2017.08.23 14:26:11 INFO  es[][o.elasticsearch.node] [sonarqube] starting ...
2017.08.23 14:26:12 INFO  es[][o.e.transport] [sonarqube] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2017.08.23 14:26:12 INFO  es[][o.e.discovery] [sonarqube] sonarqube/FzNsE7wIRFSPWf8q4E1Miw
2017.08.23 14:26:16 INFO  es[][o.e.cluster.service] [sonarqube] new_master {sonarqube}{FzNsE7wIRFSPWf8q4E1Miw}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube, master=true}, reason: zen-disco-join(elected_as_master, [0] joins received)
2017.08.23 14:26:16 INFO  es[][o.elasticsearch.node] [sonarqube] started
2017.08.23 14:26:16 INFO  es[][o.e.gateway] [sonarqube] recovered [0] indices into cluster_state
2017.08.23 14:26:16 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2017.08.23 14:26:16 INFO  app[][o.s.a.p.JavaProcessLauncherImpl] Launch process[web]: C:\ojdkbuild\jre\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.security.egd=file:/dev/./urandom -Djava.io.tmpdir=C:\sonarqube\temp -cp ./lib/common/*;./lib/server/*;C:\sonarqube\lib\jdbc\mysql\mysql-connector-java-5.1.42.jar org.sonar.server.app.WebServer C:\sonarqube\temp\sq-process9114110630788114760properties
Error occurred during initialization of VM
Could not reserve enough space for object heap
2017.08.23 14:26:16 INFO  app[][o.s.a.SchedulerImpl] Process [web] is stopped
2017.08.23 14:26:17 INFO  es[][o.s.p.StopWatcher] Stopping process
2017.08.23 14:26:17 INFO  es[][o.elasticsearch.node] [sonarqube] stopping ...
2017.08.23 14:26:17 INFO  es[][o.elasticsearch.node] [sonarqube] stopped
2017.08.23 14:26:17 INFO  es[][o.elasticsearch.node] [sonarqube] closing ...
2017.08.23 14:26:17 INFO  es[][o.elasticsearch.node] [sonarqube] closed
2017.08.23 14:26:17 INFO  app[][o.s.a.SchedulerImpl] Process [es] is stopped
2017.08.23 14:26:17 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.