Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker container configuration problem when startet with puppet module #432

Open
Thorndike opened this issue Feb 9, 2016 · 1 comment
Open
Labels

Comments

@Thorndike
Copy link

I have a sonar container which is dependant on a mariadb container. The puppet module generates a systemd entry

`# This file is managed by Puppet and local changes

may be overwritten

[Unit]
Description=Daemon for sonarqube
After=docker.service
Requires=docker.service

[Service]
Restart=on-failure
StartLimitInterval=20
StartLimitBurst=5
TimeoutStartSec=0
Environment="HOME=/root"
ExecStartPre=-/usr/bin/docker kill sonarqube
ExecStartPre=-/usr/bin/docker rm sonarqube
ExecStart=/usr/bin/docker run
--net bridge -m 0b --dns dnsIp --link mariadb-sonar:mariadb -e SONARQUBE_JDBC_USERNAME=user -e SONARQUBE_JDBC_PASSWORD=pass -e SONARQUBE_JDBC_URL="jdbc:mysql://MARIADB:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true" -p 9000:9000 -p 9092:9092 -v /opt/sonar/logs:/opt/sonarqube/logs -v /etc/localtime:/etc/localtime:ro
--name sonarqube
myRegistry/dev-env/sonar:201602030726 \

ExecStop=-/usr/bin/docker stop sonarqube

[Install]
WantedBy=multi-user.target
`
If the container is started with that code sonar can not build a datasource to the connected db. If I use the ExecStart code directly the container starts just fine.

/usr/bin/docker run --net bridge -d -m 0b --dns dnsIp --link mariadb-sonar:mariadb -e SONARQUBE_JDBC_USERNAME=user -e SONARQUBE_JDBC_PASSWORD=password -e SONARQUBE_JDBC_URL="jdbc:mysql://MARIADB:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true" -p 9000:9000 -p 9092:9092 -v /opt/sonar/logs:/opt/sonarqube/logs -v /etc/localtime:/etc/localtime:ro --name sonarqube myRegistry/dev-env/sonar:201602030726

What am I missing in the configuration of the puppet module?

RHEL7
Puppet 4.3.2
garethr-docker (v5.0.0)

@Thorndike
Copy link
Author

Finally found a solution for this! It is the faulty escaping of environment variables when creating the systemd file. With the workaround I added to

#647

and an adapted configuration the image is finally starting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants