GCC builds under teamcity docker agent

Viewed 99

I'm trying out teamcity to build GCC binaries with docker agents on centos. I setup a docker agent to connect to builder2 TC server.

$ docker pull jetbrains/teamcity-agent
$ mkdir -p /mnt/builders/teamcity/agent1/conf
$ mkdir -p /mnt/builders/teamcity/agent/work
$ mkdir -p /mnt/builders/teamcity/agent/system


docker run -it --name agent1  \
    -e SERVER_URL="http://builder2:8111" \
    -e AGENT_NAME="builder2_agent1" \
    --hostname builder2_agent \
    --dns="xx.xxx.xx.xx" \
    -v /mnt/builders/teamcity/agent1/conf:/data/teamcity_agent/conf  \
    -v /mnt/builders/teamcity/agent/work:/opt/buildagent/work  \
    -v /mnt/builders/teamcity/agent/system:/opt/buildagent/system  \
    --network='BuilderNetwork' \
    jetbrains/teamcity-agent

All that works good but in order to make a build you must import the devtoolset like this

scl enable devtoolset-10 "/bin/bash"
$ which make
/opt/rh/devtoolset-10/root/usr/bin/make

So how is this done with docker agent? Are these tools to be built in the image or do you expose the /opt/rh dir to the container? Also if you were to expose the volume then how do you install /usr/bin/scl (i.e rh package scl-utils-20130529-19.el7.x86_64) into the docker container? Does it even make sense to run an agent in docker for this?

0 Answers
Related