The story of updating SonarQube's Docker Container

Introduction

This is the story after SonarQube in The story of making SonarQube a Docker Container.

Background

I helped with some development, but it was in a subtle state with a fairly old version of SonarQube in an on-premises environment. Personally, I made SonarQube a Docker Container almost two years ago, so I provided it as the latest version, so it is a reminder at that time.

What you did

--Changed SonarQube Ver 7.4 to SonarQube Ver 8.4.2 --Changed DB for SonarQube from MySQL to PostgreSQL Ver 13.0 (End of Life of MySQL Support) --Changed docker-compose file to Ver 3

Changed SonarQube Ver 7.4 to SonarQube Ver 8.4.2

It's as easy as changing the Container Image you want to use to sonarqube: 8.4.2-community.

  # SonarQube Server
  sonarqube-server:
    container_name: sonarqube-server
    image: sonarqube:8.4.2-community

Changed DB for SonarQube from MySQL to PostgreSQL Ver 13.0

As per End of Life of MySQL Support, the latest SonarQube does not support MySQL, so PostgreSQL Transfer to.

Change the Container Image to be used to postgres: 13.0-alpine, and change volumes and ╩╗environment` by referring to the Official Guide. At the same time, change the container_name etc. to something that is easy to understand.

  #Database for SonarQube Server
  postgres-sonarqube:
    container_name: postgres-sonarqube
    image: postgres:13.0-alpine
    volumes:
      - "./data/postgresql/init:/docker-entrypoint-initdb.d"
      - "./data/postgresql/db:/var/lib/postgresql"
    ports:
      - "5432:5432"
    networks:
      - sonarqube-server-network
    environment:
      - POSTGRES_USER=sonar
      - POSTGRES_PASSWORD=sonar
      - POSTGRES_DB=sonar

Also, change the DB connection information (╩╗environment) of the SonarQube` Contaner.

  # SonarQube Server
  sonarqube-server:
    container_name: sonarqube-server
    image: sonarqube:8.4.2-community
    command: -Dsonar.web.context=/sonarqube
    links:
      - postgres-sonarqube:postgres
    volumes:
      - ./data/sonarqube/extensions/plugin:/opt/sonarqube/extensions/plugins
    ports:
      - "9000:9000"
      - "9092:9092"
    networks:
      - sonarqube-server-network
    environment:
      - SONARQUBE_JDBC_USERNAME=sonar
      - SONARQUBE_JDBC_PASSWORD=sonar
      - "SONARQUBE_JDBC_URL=jdbc:postgresql://postgres-sonarqube:5432/sonar"

Changed docker-compose file to Ver 3

Since Ver3 is the mainstream now, change the versions of the docker-compose file to 3.

version: '3'
services:

Operation check

After dealing with this, check the operation with the following command and finish the work.

docker-compose up --force-recreate sonarqube-server

Impressions

It was easy because the main work was version upgrade work without considering data migration. I felt that this area was easy and good if I made it into a Docker Container again. I think I can do my best with this for a while.

The correspondence of this article is published in the following github repository, so please refer to it if you are interested. https://github.com/awakuwaku/sonar-qube-docker

reference

Recommended Posts

The story of updating SonarQube's Docker Container
Change the location folder of Docker image & container
Docker monitoring-explaining the basics of basics-
Understand the basics of docker
Nginx container that displays the Hostname of the host running Docker
Get only the ID of the container specified by docker ps
The story of dieting the container of the Elixir application as much as possible
[Java version] The story of serialization
The story of @ViewScoped consuming memory
The story of pushing a Docker container to GitHub Package Registry and Docker Hub with GitHub Actions
The story of encountering Spring custom annotation
The story of RxJava suffering from NoSuchElementException
The story of AppClip support in Anyca
[Docker] Start the container as soon as possible
Japanese setting of mysql in Docker container
The story of writing Java in Emacs
The story of low-level string comparison in Java
The story of making ordinary Othello in Java
[Docker] Check the running container and enter there
The story of learning Java in the first programming
The story of making the existing Dockerfile GPU compatible
The story that docker had a hard time
The story of introducing Ajax communication to ruby
Improve the performance of your Docker development environment
The story of raising Spring Boot 1.5 series to 2.1 series
The story of tuning android apps with libGDX
Up to the point of launching a Docker container built using RedHat Quarkus
Change the timezone of the https-portal container to JST
Small Docker container
The story of adding the latest Node.js to DockerFile
How Docker works ~ Implement the container in 60 lines
The story of initializing Money :: Currency when testing
[Docker] How to see the contents of Volumes. Start a container with root privileges.
Volume 3 types of Docker Compose considered from the purpose
I tried to summarize the state transition of docker
Docker the development environment of Ruby on Rails project
The story of migrating from Paperclip to Active Storage
The story of making a reverse proxy with ProxyServlet
The story of an Illegal State Exception in Jetty.
Run the Android emulator on Docker using Android Emulator Container Scripts
Verification of the relationship between Docker images and containers
[WIP] I tried the configuration of Docker + Streama + NFS
SSL in the local environment of Docker / Rails / puma
Check the rate limit application status of docker pull
The story of making Dr. Oakid using LINE BOT
The story of making dto, dao-like with java, sqlite
The world of clara-rules (2)
Introduction of Docker --Part 1--
The story of migrating a stray batch without an owner from EC2 to a Docker environment
Automatically start the container
Judgment of the calendar
The world of clara-rules (4)
The world of clara-rules (1)
The world of clara-rules (3)
The world of clara-rules (5)
The idea of quicksort
Docker container usage scene
The idea of jQuery
The story of managing session information by introducing gem Redis
Copy and paste the file contents in Ubuntu's Docker container
The story of raising Spring Boot from 1.5 series to 2.1 series part2