I am using a docker image for SonarQube (https://github.com/SonarSource/docker-sonarqube).
However, I would like to extend the image and add a couple of plugins. In order to do that, I want to create a new Dockerfile and add all the extra commands required:
FROM sonarqube:5.1
RUN echo 'I will add some commands here...!' >> /tmp/test
Then, instead of specify the image in the docker-compose, I’ll specify the build path, so it will use the local Dockerfile.
However, it seems that “build” doesn’t work as expected because I am getting this error:
==> default: time="2015-10-02T13:02:49Z" level=info msg="Creating stack sonarqube"
==> default: time="2015-10-02T13:02:49Z" level=info msg="Project [sonarqube]: Starting project "
==> default: time="2015-10-02T13:02:49Z" level=info msg="[0/1] [SonarQube]: Starting "
==> default: time="2015-10-02T13:02:49Z" level=info msg="Creating service SonarQube"
==> default: time="2015-10-02T13:02:49Z" level=info msg="Uploading build for SonarQube using provider S3"
==> default: time="2015-10-02T13:03:19Z" level=error msg="Failed Starting SonarQube : NoCredentialProviders: no valid providers in chain"
==> default: time="2015-10-02T13:03:19Z" level=error msg="Failed to start: SonarQube : NoCredentialProviders: no valid providers in chain"
==> default: time="2015-10-02T13:03:19Z" level=fatal msg="NoCredentialProviders: no valid providers in chain"
Doesn’t rancher-compose support this feature? I am not using a S3 provider, just a custom one.
The only solution I can think is upload the new Dockerfile into dockerhub and use the new image, but I would like to use the local Dockerfile instead. Is it possible? Thanks!
“Docker builds are supported in two ways. First is to set build: to a git or HTTP URL that is compatible with the using the Docker Remote API. The second approach is to set build: to a local directory and the build context will be uploaded to S3 and then built on demand on each node.”
Basically, in order to build your local DockerFile, you must use S3.
Alternatively, you could put your Dockerfile info into a git or HTTP URL and point the build to the URL.
Are you considering supporting local DockerFile soon? In the meanwhile I’ll need to deploy probably a local HTTP server in order to provide the DockerFile as we might not have external network in some PCs.
@denise
Thanks for the example. In your raw docker file it doesn’t depends on ohther fiels/scripts. My docker file has a CMD that calls an bash scripts, like below. How does Rancher compose handle this case? And should I use the raw docker file link instead of something like https://github.com/rancher/tiny-build? I have did some self study and was not able to successful run the container by rancher-compose command…