![]() ![]() Fortunately, Docker Compose automatically links all the services in an application with their service name, so we can simply use server and it will always point to our TeamCity Server container, even when recreated. Be wary!Īgain, we provide one environment variable, SERVER_URL, that defines what TeamCity server our agent connects to. Image: 'jetbrains/teamcity-minimal-agent' #the official JetBrains imageįor some reason, the teamcity-minimal-agent scripts are incredibly picky about format of SERVER_URL. Now, our TeamCity server still needs an agent to do the grunt work of our builds, so let's also add an agent to our Compose services: version: '2' Note that some other (usually older) guides recommend also setting -XX:MaxPermSize: this is no longer needed! My First Agent Around 4GB and above, it starts becoming necessary to also include a value for -XX:ReservedCodeCacheSize= but smaller deployments don't need this.įor more detail, checkout the documentation on configuring TeamCity memory settings. Here, I'm telling it that the JVM should max out at 750MB RAM, which is JetBrains's recommendation for minimum/small deployments. You'll see the TEAMCITY_SERVER_MEM_OPTS option above TeamCity veterans will recognise it as how TeamCity's underlying JVM picks up its memory configuration, but if you're new to TeamCity, or the JVM (like me), it's probably a little confusing.Įssentially (and this is an over-simplification) TeamCity relies on the JVM for controlling it's maximum RAM usage, and the JVM uses the values you specify in the TEAMCITY_SERVER_MEM_OPTS environment variable. The volume/directory you map into datadir will be used to hold TeamCity's configuration and project data (likewise for the self-explanatory logs volume). '/opt/teamcity/log:/data/teamcity/logs' '/opt/teamcity/data:/data/teamcity_server/datadir' Image: 'jetbrains/teamcity-server' # the official JetBrains image Next, in my new docker-compose.yml file, I start by defining the TeamCity server: version: '2' I'll be assuming you're running on a Linux box, but these commands should be pretty easy to co-opt to any other OSes (just update paths as appropriate).įor my setup, I created a simple directory structure under /opt to hold my server and agent data: /opt/teamcity/ Fortunately, JetBrains have now started publishing official images for both the TeamCity Server and Agent components, so today we'll be setting up a simple TeamCity environment using Docker Compose.Įven better, JetBrains offers TeamCity Professional completely free! No reason not to try it out. Recently, I needed a quick TeamCity build environment to test some new development changes. Docker is an incredibly powerful tool for building networks of interconnected components without worrying about dependencies, conflicts or machine provisioning. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |