-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add support for additional packages #11
Comments
Interesting idea, i'll look into that 👍 |
That not only interesting, that's a must have! Sorry, but how should bamboo do "it's thing" without packages like "composer" and other stuff? Or run php unit tests without installed php? Currently the whole docker image is useless for my work. I'm working with bamboo since years, but within this image I can't use it in any way 😠 |
Another method to abstract the build dependencies is to do the building inside a docker container. I am running this successfully for a while. Therefore i armed the bamboo image with the docker package: For a more generalized usage, the group number of the docker group should be configurable. In the linked commit i used my docker group number of my hostsystem. The way i do (and prefer to do) CI:
--> Summarizing you don't need build dependency management in bamboo, when you use the docker in docker approach for CI. This is very handy, especially when you place your CI build environment information directly into your project as an Dockerfile. So i would vote for an bamboo image from @cptactionhank (which is better supported as my fork), providing the docker runtime, with configurable docker group ID. If you wish, i can explain further the docker in docker approach for CI. best, |
The problem when you run bamboo plan with a "remote" docker daemon, is that you can't use simple mounted volumes to pass files in/out of the sub docker container as they are not present on the machine/container that run the docker daemon itself. It'd be nice if the bamboo/bamboo.agent containers could offer a "sub" docker daemon inside their own container, besides the bamboo processes. This way the docker daemon would be able to mount path from the working directories of the bamboo/bamboo.agent. So I suggest to create docker containers inside the bamboo containers, not as siblings. This can be done, as docker inside another docker is supported. |
Yep, there are several pros and cons between docker in docker and docker as siblings. You mentioned https://hub.docker.com/_/docker/, where also https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/ is linked. My decision is based on: cons of docker in docker:
pro docker in docker:
neutral:
So i decided to use the sibling way for a machine, where the CI administrator also has access to the host docker system. Than you are right, i had to retrieve the host-mounted path of the bamboo build folder, to be able to mount it into the container. As long as this is possible for the CI-admin i would prefere the sibling way. |
I've found the very same problem with my first test. Besides the support to install deps on creating the container. Is that it switch to USER daemon:daemon that doesn't have any privileges to apk :( so you can't even installed on build process. bash-4.4$ apk add php
ERROR: Unable to lock database: Permission denied
ERROR: Failed to open apk database: Permission denied
bash-4.4$ su -
su: must be suid to work properly 😔 |
Here is my config that allowed to install
Also, the docker-compose needs the following instead of the
116 was the GID on my server. Many thanks to @cguentherTUChemnitz for providing the base work for this. |
I wanted to install npm on my docker, but if exec-ing into it and doing a simple Someone has better idea? Maybe provide npm in runner image?
|
You are not logged in as root, use the |
How do you run the command with --user flag? I get permission denied |
Thanks @cptactionhank it worked for me. This is how i ran it
|
Would be nice to support the setup of additional (apk) packages through a environment variable.
This way we can add build capabilities without forking the docker image.
Something like :
X_ADDITIONAL_PACKAGES : "nodejs nodejs-npm"
That would run at startup :
apk add --update nodejs nodejs-npm
This way bamboo can build stuff with nodejs, or with any deployment specific dependencies ;-)
The text was updated successfully, but these errors were encountered: