SonarQube docker images

sonarqube
branches
docker

(Maciej Ptak) #1

Hi,

Can you please share any plans to create docker image for SonarQube 7.1 or 7.4 as Developer Edition?
I would be pleased if I could use such with branch-plugin included.

Also please share any details regarding next LTS version.

Best Regards,
Maciej Ptak


(Eugene Dubrovka) #2

We are using docker image for SQ7.1 Developer Edition. Works fine with branches. Get it from Docker Hub.
But there is no image for SQ7.4. SQ Sales contacted us whether we have would like to extend the license for one more year but could not provide any info about release plans on docker image.

This kind of relates also to Docker Container for 7.3 .


(Maciej Ptak) #3

Hi Eugene,

We have installed SQ 7.1 DE and when it comes to branch plugin I got following:


That’s why I thought it is not available in this particular docker image.

Best,
Maciej


(Eugene Dubrovka) #4

You should also get the license plugin installed and one more menu option under Administration -> General, I think.

But that is all. Now we are both stuck with this version. We have bunch of updated for plugins like Java or Git but we cannot install them since we require 7.3+. :smiley: Nevertheless, enjoy.


(Maciej Ptak) #5

Thanks!


(Gash Teshome) #6

@maciej.ptak If you are still looking for a Docker image for SQ 7.4 Developer Edition, I have a Dockerfile you can use to build your own. It’s based on the last official Dockerfile from SonarSource.


(Eugene Dubrovka) #7

@gteshome , :+1:
I am afraid that this is the only option now…
For example, we already have an internal ticket to build docker image out of pretty much similar Dockerfile.


(Maciej Ptak) #8

Thanks Gash, awesome, I was looking just looking for this.


(Janos Gyerik) #9

We’ve just released official images of SonarQube Community Edition 7.4 and 6.7.6, available on the hub.

We don’t plan to release images of the commercial editions at the moment, but it’s definitely on our radars.


Dev edition as docker image
Docker image for SonarQube Community Edition 7.4
(Colin Mueller) #10

:tada:


(Andrew) #11

@gteshome, In using your Docker image (thank you!), have you tried to apply a Dev license to the image to determine if the dev edition is functional when using the image?

How can I add custom .jar files to the image, such as code scan?

Thanks!


(Marjo Hartman) #12

When trying to build this docker image with:

docker build -f Dockerfile-sonarqube -t sonraqube:developer .

It seems to be stuck half way:

  • mktemp -d
  • export GNUPGHOME=/tmp/tmp.Z6xU0byEc5
  • gpg --keyserver keyserver.ubuntu.com --recv-keys 0x036a9c25bf357dd4
    gpg: keybox ‘/tmp/tmp.Z6xU0byEc5/pubring.kbx’ created

Am I doing something wrong?


(Eugene Dubrovka) #13

Try this

  1. Use --batch for gpg command
  2. use keyserver hkp://ha.pool.sks-keyservers.net:80
  3. use keyserver hkp://ipv4.pool.sks-keyservers.net:80
  4. use key B42F6819007F00F88E364FD4036A9C25BF357DD4 and F1182E81C792928921DBCAB4CFCA4A29D26468DE
  5. look here for reference: https://gist.github.com/degree/51accc0da6cab6d8b5fb06b833bdac76 (it builds but is not guaranteed to work)

Dev edition as docker image
(Marjo Hartman) #14

That got me a bit further. Now I am stuck on:

  • gpg --batch --verify sonarqube.zip.asc sonarqube.zip
    gpg: Signature made Mon Oct 29 11:41:33 2018 UTC
    gpg: using RSA key CFCA4A29D26468DE
    gpg: Can’t check signature: No public key

(Marjo Hartman) #15

Thanks. Got it solved using the link you provided.
Now I have an image. Let’s see if I can get it running now.


(Marjo Hartman) #16

Pity: starting a container with this image fails with:

standard_init_linux.go:190: exec user process caused “exec format error”


(Gash Teshome) #18

@AndrewG Yes, this works with the developer license our company has.

To add the jar, the easiest thing to do is to build your own image by getting the Dockerfile and run.sh files, put them in a directory on your computer, add a copy of the jar in the same directory and add a line like this to the Dockerfile:

COPY <file>.jar $SONARQUBE_HOME/extensions/plugins .


(Gash Teshome) #19

@Marjo_Hartman I don’t think you’re doing anything wrong. When I have a problem at that step it’s usually because the keyserver is unreachable. Switching the keyserver as @degree recommended is the easiest solution.

That error is usually because the binary format of the executable doesn’t match the system it’s running on. How are you running the image?


(Florian Huber) #20

Hi!
Is there already a schedule for the Developer Images?


(Eugene Dubrovka) #21

The gist I have posted earlier is updated with one line: USER sonarqube. I have managed to build the image and run it at least locally. Analysis does not work without a valid license.