[
https://issues.apache.org/jira/browse/BUILDS-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14160738#comment-14160738
]
Roman Shaposhnik commented on BUILDS-25:
----------------------------------------
Ok, let me provide a few answers:
[~gkesavan] the way Docker would work for our builds would literally not
require *anything* but installation of Docker service on the slaves and
including jenkins user into the docker group so that it can communicate with
the Docker service via the protected socket. If you want to lock it even
tighter you can (like disallowing ingress traffic, etc) but it won't buy you
much more than what a jenkins user can do on our slaves today. You don NOT need
sudo.
This setup doesn't require you to have extra slaves or anything like that. In
fact, build in a well-defined environment as though you
had a slave configured with it becomes as easy as the command I posted. So,
for example, if you want to produce packages for 4 different Linux flavors all
you'd have to do is to have a matrix job that iterates over labels
corresponding to the names of Docker containers and you can run that job on any
slave that has Docker. We've been using this approach on Bigtop's Jenkins and
it works great.
Ultimatelly, it results in a setup where you *never* *ever* have to file a JIRA
asking to update something on a slave -- your Docker container has all of the
dependencies and they are never conflicting with anybody else's dependencies.
On top of that you basically empower developers to reproduce builds *exactly*
as they are happening on ASF Jenkins. This has been a huge bonus for us in
Bigtop.
[~abayer] as long as our slaves are running a resonably recent version of Linux
kernel (Ubuntu 12.04+) all you need to do is the following two steps:
* install and start up the Docker service following these
https://docs.docker.com/installation/ubuntulinux/
* make sure that jenkins is added to the docker group
The installation itself is as easy as it gets. Docker is implemented in Go
which means no dependencies whatsoever.
> please consider providing Docker on Jenkins slaves
> --------------------------------------------------
>
> Key: BUILDS-25
> URL: https://issues.apache.org/jira/browse/BUILDS-25
> Project: Infra Build Platform
> Issue Type: New Feature
> Components: Jenkins
> Reporter: Roman Shaposhnik
>
> Docker (https://www.docker.com/) provides a very powerful set of tools around
> extremely lightweight container environments. This is extremely useful in
> situations where builds need to be performed in presence of certain
> system-level build dependencies and on different flavors of Linux.
> With Docker, one can simply execute the following command as an entry point
> into a build script:
> {noformat}
> docker run -v `pwd`:/ws $DOCKER_IMAGE bash -c 'cd /ws ; make foo'
> {noformat}
> and not require pollution of Jenkins slaves with system dependencies and
> installation of new slaves. E.g. DOCKER_IMAGE=fedora would give you the
> latest fedora build environment.
> It would be extremely useful to provide Docker service on ASF build slaves.
> Please let me know how can I help.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)