This repository contains docker-compose file to easily run to the code examples in the udemy courses
This repository is part of my udemy courses:
If you're interested in learning more about Sonarqube or Github actions, you can check if the are any discount coupons available in the course section of devopsbrains.com
- Docker
- Docker compose
- ngrok account (Optional. Needed only if you want to expose the services in Internet)
You can check out other branches of the repository to launch other versions of SonarQube than that of the main branch. Check other branches available in the repository.
If you had a previous version and you want to modify it, I advise you to erase the volumes associated with the previous installation of docker compose.
- If you want to expose any of the services in Internet with ngrok, you'll need:
NGROK_AUTHTOKEN=<your token>
NGROK_DOMAIN=<your domain>
- Sonarqube:
docker-compose up - Sonarqube with postgres:
docker-compose -f compose.yaml -f compose.postgres.yaml up - Sonarqube + ngrok:
docker-compose --profile public up - Jenkins:
docker compose -f compose.jenkins.yaml up - Jenkins + ngrok:
docker compose -f compose.jenkins.yaml --profile public up
NOTE: You'll have a single domain with free ngrok account and you can only have a single ngrok session. So you can only expose either SonarQube or Jenkins at the same time
- After launching Jenkins, you can open in the web browser http://localhost:8080/
- We can skip plugin installation, since the plugins needed for the course exercises are already installed. "Select plugins to install" > "None" > "Install"
- We create an admin user
- We choose the default server URL: "http://localhost:8080/"
- The configuration of credentials and tools such as NodeJs and SonarScanner is explained during the course
A student had this problem and managed to solve it, by adding this instruction in the Dockerfile after the FROM insttruction
RUN git config --global --add safe.directory "*"
The plugin download from Jenkins mirrors fail sporadically. In my case I had problems with ftp.halifax.rwth-aachen.de. That is why I ended up including the plugin installation in the Dockerfile with jenkins-plugin-cli