Friday, December 2, 2016

Error while dockerizing sonarqube using harbur/docker-sonarqube

If you try to dockerize sonarqube using docker-sonarqube, you may encounter the following error while running the "docker build ." command:
[...]

E: The method driver /usr/lib/apt/methods/https could not be found.
The command '/bin/sh -c apt-get update && apt-get clean ### Sonar version 5.6 - timestamp' returned a non-zero code: 100
According to this answer, it seems that we need to add some https sources. So,  add support for https apt sources by installing a couple of packages:

apt-get install apt-transport-https ca-certificates
This can be done by modifying the file Dockerfile, located in the folder docker-sonarqube
Look for:

RUN apt-get install -y --force-yes sonar=5.6
replace it with the following:

RUN apt-get install apt-transport-https ca-certificates -y --force-yes sonar=5.6

And that's it.

David E. Fonseca