DEV Community

Cover image for SonarQube Community Edition in a Docker Container on Mac M1
Kevin Lupera
Kevin Lupera

Posted on

1 1 1 1 1

SonarQube Community Edition in a Docker Container on Mac M1

Requirements

  • Docker

If you don't already have docker installed, this link has more information for Mac and Windows. docker

Start container use:

I am using a Mac with an Apple M1 chip, so I was successful using this docker-compose:

  1. Clone repo https://github.com/kevinlupera/SonarQube-docker-compose
  2. Move into repository cd SonarQube-docker-compose
  3. Start Containers docker-compose up

Stop container use:

Control + C in this terminal or docker-compose down

Scanning Your Code

Before scanning your code with SonarQube, you need to install SonarScanner on the operating system where your project is located.

For Mac, you can follow these steps:
brew install sonar-scanner

Once you have installed the SonarScanner, you can proceed with the following steps:

  1. Go to the SonarQube URL (http://localhost:9000).
  2. Log in to your SonarQube instance using the default credentials (login/pwd: admin).
  3. Navigate to the Projects page.
  4. Click on the “Create Project” button and choose the “Manually” option.
  5. Fill in the required fields with relevant project information.
  6. Generate a token and click “Continue.”
  7. Select the appropriate option for your project’s language (e.g., “Other” for JS, TS, Go, Python, PHP).
  8. Choose your operating system.
  9. You will see a code snippet that represents the command to run the scanner. It will look similar to the following:
sonar-scanner \
-Dsonar.projectKey=PROJECTKEY\
-Dsonar.sources=. \
-Dsonar.host.url=http://localhost:9000 \
-Dsonar.login=TOKEN
Enter fullscreen mode Exit fullscreen mode

Once the analysis is complete, return to the SonarQube server.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more