Today we will be running sonarqube on unRaid. unRaid has docker support, but it’s done via some plugin (dockerMan), that’s why it’s not as straighforward as described in official docs.
template
templates in unRaid are stored in private repo. you can create one in
/boot/config/plugins/community.applications/:
root@nas:~# cd /boot/config/plugins/community.applications/
root@nas:/boot/config/plugins/community.applications# mkdir -p private/private
root@nas:/boot/config/plugins/community.applications# cd private/private/
root@nas:/boot/config/plugins/community.applications/private/private# vi sonarqube.xml
Here is an exmaple of how the template may look like:
<?xml version="1.0"?>
<Container version="2">
<Name>sonarqube</Name>
<Repository>sonarqube</Repository>
<Registry/>
<Network>bridge</Network>
<MyIP/>
<Shell>sh</Shell>
<Privileged>false</Privileged>
<Support/>
<Project/>
<Overview/>
<Category/>
<WebUI/>
<TemplateURL/>
<Icon/>
<ExtraParams>--ulimit nofile=65536:65536</ExtraParams>
<PostArgs/>
<CPUset/>
<DateInstalled>1611916765</DateInstalled>
<DonateText/>
<DonateLink/>
<Description/>
<Networking>
<Mode>bridge</Mode>
<Publish>
<Port>
<HostPort>9000</HostPort>
<ContainerPort>9000</ContainerPort>
<Protocol>tcp</Protocol>
</Port>
</Publish>
</Networking>
<Data>
<Volume>
<HostDir>/mnt/cache/appdata/sonarqube/sonarqube_data</HostDir>
<ContainerDir>/sonarqube_data</ContainerDir>
<Mode>rw</Mode>
</Volume>
<Volume>
<HostDir>/mnt/cache/appdata/sonarqube/sonarqube_logs</HostDir>
<ContainerDir>/sonarqube_logs</ContainerDir>
<Mode>rw</Mode>
</Volume>
<Volume>
<HostDir>/mnt/cache/appdata/sonarqube/sonarqube_extensions</HostDir>
<ContainerDir>/sonarqube_extensions</ContainerDir>
<Mode>rw</Mode>
</Volume>
</Data>
<Environment>
<Variable>
<Value>jdbc:postgresql://postgres-host/sonardb</Value>
<Name>SONAR_JDBC_URL</Name>
<Mode/>
</Variable>
<Variable>
<Value>sonaruser</Value>
<Name>SONAR_JDBC_USERNAME</Name>
<Mode/>
</Variable>
<Variable>
<Value>sonaruser</Value>
<Name>SONAR_JDBC_PASSWORD</Name>
<Mode/>
</Variable>
</Environment>
<Labels/>
<Config Name="web" Target="9000" Default="" Mode="tcp" Description="Container Port: 9000" Type="Port" Display="always" Required="false" Mask="false">9000</Config>
<Config Name="sonarqube_data" Target="/sonarqube_data" Default="" Mode="rw" Description="Container Path: sonarqube_data" Type="Path" Display="always" Required="false" Mask="false">/mnt/cache/appdata/sonarqube/sonarqube_data</Config>
<Config Name="sonarqube_logs" Target="/sonarqube_logs" Default="" Mode="rw" Description="Container Path: sonarqube_logs" Type="Path" Display="always" Required="false" Mask="false">/mnt/cache/appdata/sonarqube/sonarqube_logs</Config>
<Config Name="sonarqube_extensions" Target="/sonarqube_extensions" Default="" Mode="rw" Description="Container Path: sonarqube_extensions" Type="Path" Display="always" Required="false" Mask="false">/mnt/cache/appdata/sonarqube/sonarqube_extensions</Config>
<Config Name="SONAR_JDBC_URL" Target="SONAR_JDBC_URL" Default="jdbc:postgresql://localhost/sonardb" Mode="" Description="Container Variable: SONAR_JDBC_URL" Type="Variable" Display="always" Required="false" Mask="false">jdbc:postgresql://postgres-host/sonardb</Config>
<Config Name="SONAR_JDBC_USERNAME" Target="SONAR_JDBC_USERNAME" Default="sonaruser" Mode="" Description="Container Variable: SONAR_JDBC_USERNAME" Type="Variable" Display="always" Required="false" Mask="false">sonaruser</Config>
<Config Name="SONAR_JDBC_PASSWORD" Target="SONAR_JDBC_PASSWORD" Default="CHANGEME" Mode="" Description="Container Variable: SONAR_JDBC_PASSWORD" Type="Variable" Display="always" Required="true" Mask="true">CHANGEME</Config>
</Container>
Most likely, you will have 2 more issues here:
- installing postgres
- increasing vmem on the host system (https://www.elastic.co/guide/en/elasticsearch/reference/5.5/vm-max-map-count.html)