Docker startup failing

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this
    SonarQube 8.3 D.E. docker image, using bind-mounts (need persistent storage in AWS)
    I’m looking at the file and it’s not clear how to invoke this. My current startup is using:
docker run -d -it --name sonarqube --restart=unless-stopped --stop-timeout 3600 \
  --ulimit nofile=65536 --ulimit nproc=65536 \
  -v $SONARQUBE_HOME/data:/opt/sonarqube/data \
  -v $SONARQUBE_HOME/extensions:/opt/sonarqube/extensions \
  -v $SONARQUBE_HOME/logs:/opt/sonarqube/logs \
  -v $SONARQUBE_HOME/temp:/opt/sonarqube/temp \
  -e SONAR_JDBC_URL=jdbc:postgresql://$DB_URL \
  -e LDAP_URL=ldaps://$LDAP_URL:3269 \
  -e LDAP_REALM=dc=corporate,dc=local \
  -e LDAP_BINDDN='cn=ldapanon,ou=Service Accounts,ou=Universal,dc=corporate,dc=local' \
  -e LDAP_BINDPASSWORD='Anonymous@' \
  -e LDAP_USER_BASEDN=dc=corporate,dc=local \
  -e LDAP_USER_REQUEST='(&(objectClass=user)(objectCategory=Person)(samAccountName={login}))' \
  -p 9000:9000 $IMG_NAME \

I am getting permissions error when first bringing up, so I need to run as root initially to set permissions.

Hi @Jaff,

You say you run into permission issues. If you remove all the -v options, I guess it works? What kind of permissions are set on the $SONARQUBE_HOME directory? Does the user running Docker have write permissions on this folder?

The script is run as root, to start the docker image. Permissions on the $SONARQUBE_HOME directory are owner: root. I suppose the directory could be set with chmod 777 so any user could write

Issue resolved; our custom image was setting USER to root while installing java keystore with company certs. Then setting USER to sonarqube. Following this discussion, I removed both USER settings, and I was able to startup successfully while using bind-mounts.

Great, thanks for posting the solution here :+1:.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.