How to install sonarqube developer edition via Docker? - docker

I’m trying to install Sonarqube Developer Edition server but after installation, in footer page, it shows that it’s the Community Edition that is installed.
Here is my docker command:
docker run -d --name sonarqube --restart=always -p 9000:9000 -e sonar.jdbc.url=<my_jdbc_url> -e sonar.jdbc.username=<my_db_user> -e sonar.jdbc.password=<my_db_password> --network sonarqube_network --volume sonarqube:/opt/sonarqube sonarqube:9.7.1-developer
Thanks for you help !

Can you try:
docker run -d -p 9000:9000 -p 9092:9092 sonarqube:developer
Navigate to http://localhost:9000
Or you may be able pass your variables directly in by running:
docker run -d -e SONAR_TOKEN=<YOUR_TOKEN> -e SONAR_EDITION=developer -p 9000:9000 -p 9092:9092 sonarqube:developer

Maybe I missed something in my script, but otherwise I managed to solve my problem with docker compose
version: "3"
services:
sonarqube:
image: sonarqube:9.7.1-developer
environment:
SONAR_JDBC_URL: <my_jdbc_url>
SONAR_JDBC_USERNAME: <my_db_username>
SONAR_JDBC_PASSWORD: <my_db_password>
volumes:
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_logs:/opt/sonarqube/logs
ports:
- "9000:9000"
volumes:
sonarqube_data:
sonarqube_extensions:
sonarqube_logs:

Related

I get an error when I try to run Pihole on Docker in Windows

I have a problem with Docker. I wanted to run this command in cmd and also Windows-Powershell.
docker run -d --name pihole -e ServerIP=192.168.178.20 -e WEBPASSWORD=XXX -e TZ=Europe/Berlin -e DNS1=172.17.0.1 -e DNS2=1.1.1.1 -e DNS3=192.168.178.1 - p 80:80 -p 53:53/tcp -p 443:443 --restart=unless-stopped pihole/pihole:latest
I typed in the right password I just censored it here. Everytime I run this command I get the report:
invalid reference format
Can anyone of you help me, I don´t know what to do.

How to connect my Kibana to ElasticSearch in the docker run command?

Just trying to learn to setup Kibana and Elastic search using native docker command (i.e. not using Docker-Compose).
Below are the commands I run
docker network create es-net
docker run -d --name es-cluster \
--net es-net -p 9200:9200 \
-e "xpack.security.enabled=false" \
-e "discovery.type=single-node" \
docker.elastic.co/elasticsearch/elasticsearch:7.2.0
docker run -d --net es-net -p 5601:5601 \
-e ELASTICSEARCH_URL=http://es-cluster:9200 \
docker.elastic.co/kibana/kibana:7.2.0
Somehow Kibana is not loading the elastic search up when I run http://localhost:5601/ and always with the message Kibana server is not ready yet
I follow the answer as per Kibana on Docker cannot connect to Elasticsearch, to ensure the ELASTICSEARCH_URL is correctly set, but it is still not coming up. Anything I miss?
note: tested with curl 0.0.0.0:9200, the elastic search is already running
Looks like since I'm in version 7.2.0 of Kibana, it has changed from ELASTICSEARCH_URL to ELASTICSEARCH_HOSTS
as per https://www.elastic.co/guide/en/kibana/current/docker.html
docker run -d --net es-net -p 5601:5601 \
-e ELASTICSEARCH_HOSTS=http://es-cluster:9200 \
docker.elastic.co/kibana/kibana:7.2.0
With this in place, all should work then.

InfluxDB on Docker-Compose can't read SSL cert file

I'm having some troubles trying to configure SSL with InfluxDB v1.8 running on Docker Compose.
I followed the official documentation to enable HTTPS with self-signed certificate, but the container crashes with the following error:
run: open server: open service: open "/etc/ssl/influxdb-selfsigned.crt": no such file or directory
It works if I run this configuration using docker run command:
docker run -p 8086:8086 -v $PWD/ssl:/etc/ssl \
-e INFLUXDB_DB=db0 \
-e INFLUXDB_ADMIN_USER=admin \
-e INFLUXDB_ADMIN_PASSWORD=supersecretpassword \
-e INFLUXDB_HTTP_HTTPS_ENABLED=true \
-e INFLUXDB_HTTP_HTTPS_CERTIFICATE="/etc/ssl/influxdb-selfsigned.crt" \
-e INFLUXDB_HTTP_HTTPS_PRIVATE_KEY="/etc/ssl/influxdb-selfsigned.key" \
-d influxdb
My docker-compose.yml is the following:
version: "3"
services:
influxdb:
image: influxdb
ports:
- "8086:8086"
volumes:
- influxdb:/var/lib/influxdb
- ./ssl:/etc/ssl/
environment:
- INFLUXDB_DB=db0
- INFLUXDB_ADMIN_USER=admin
- INFLUXDB_ADMIN_PASSWORD=supersecretpassword
- INFLUXDB_HTTP_HTTPS_ENABLED=true
- INFLUXDB_HTTP_HTTPS_CERTIFICATE="/etc/ssl/influxdb-selfsigned.crt"
- INFLUXDB_HTTP_HTTPS_PRIVATE_KEY="/etc/ssl/influxdb-selfsigned.key"
- INFLUXDB_HTTP_AUTH_ENABLED=true
volumes:
influxdb:
If I set INFLUXDB_HTTP_HTTPS_ENABLED to false, I can see that cert and key files are mounted as they should in /etc/ssl in the container ( docker exec -it airq_influxdb_1 ls -la /etc/ssl )
Do you have any idea why this is happening and how to solve it?
The environment variables passed in the docker-compose.yml are strings. You don't need to pass the quotes.
The influx DB is looking for the certificate under "/etc/ssl/influxdb-selfsigned.crt"...literally
Simply remove the quotes and the DB will start:
...
- INFLUXDB_HTTP_HTTPS_ENABLED=true
- INFLUXDB_HTTP_HTTPS_CERTIFICATE=/etc/ssl/influxdb-selfsigned.crt
- INFLUXDB_HTTP_HTTPS_PRIVATE_KEY=/etc/ssl/influxdb-selfsigned.key
...

How to set kibana ELASTICSEARCH_URL parameter

Docker for windows: 2.0.0.3(31259)
I run a elasticsearch and kibana in docker. elasticsearch is run .But kibana can not run . It always try to connected http://elasticsearch:9200 .I set
the ELASTICSEARCH_URL kibana command. But not work
request http://localhost:5601/. Kibana server is not ready yet
docker run -d --name d-elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.1.1
docker run -d --name d-kibana -e ELASTICSEARCH_URL=http://192.168.0.73:9200 -p 5601:5601 docker.elastic.co/kibana/kibana:7.1.1
kibana docker log:
{"type":"log","#timestamp":"2019-06-05T08:21:26Z","tags":["warning","elasticsearch","data"],"pid":1,"message":"Unable to revive connection: http://elasticsearch:9200/"}
In version 7, Kibana uses a different environment variable: ELASTICSEARCH_HOSTS
docker run -d --name d-kibana -e "ELASTICSEARCH_HOSTS=http://192.168.0.73:9200" -p 5601:5601 docker.elastic.co/kibana/kibana:7.1.1

ElasticSearch with Docker - Enable Anonymous Access

For local development, I want to run an ElasticSearch (5.5.2) container using Docker, but I don't want to have to deal with authentication.
I have read https://www.elastic.co/guide/en/x-pack/5.5/anonymous-access.html, and it seems that the container comes with X-Pack which adds security (requiring a username and password).
Previously I have been running:
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" --name es docker.elastic.co/elasticsearch/elasticsearch:5.5.
How can I allow anonymous access?
Add the environmental variable xpack.security.enabled=false to the docker run command.
Complete command:
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "xpack.security.enabled=false" --name es docker.elastic.co/elasticsearch/elasticsearch:5.5.2
Reference: https://discuss.elastic.co/t/how-do-i-disable-x-pack-security-on-the-elasticsearch-5-2-2-docker-image/78183/4

Resources