<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chen, Zidi</title>
    <description>The latest articles on DEV Community by Chen, Zidi (@chenzidi).</description>
    <link>https://dev.to/chenzidi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F615507%2F297ffb27-58ed-44e8-8c45-c8470fdefcc8.jpeg</url>
      <title>DEV Community: Chen, Zidi</title>
      <link>https://dev.to/chenzidi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chenzidi"/>
    <language>en</language>
    <item>
      <title>Run TeamCity on Docker </title>
      <dc:creator>Chen, Zidi</dc:creator>
      <pubDate>Fri, 23 Apr 2021 16:26:51 +0000</pubDate>
      <link>https://dev.to/chenzidi/run-teamcity-on-docker-5f8b</link>
      <guid>https://dev.to/chenzidi/run-teamcity-on-docker-5f8b</guid>
      <description>&lt;p&gt;Author✒️: &lt;a href="https://github.com/Chen-Zidi" rel="noopener noreferrer"&gt;Zidi Chen&lt;/a&gt;, &lt;a href="https://github.com/Spycsh" rel="noopener noreferrer"&gt;Sihan Chen&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This is a small tutorial about how to run TeamCity on the docker container. TeamCity is a CI/CD tool published by JetBrains. It basically helps to deliver software with high quality faster and simplier. Developers can specify the builds, run the builds and view the results, which will be introduced later in this tutorial. Running TeamCity on Docker would allow us to use TeamCity without local installation, regardless of operating systems.&lt;/p&gt;

&lt;p&gt;This tutorial includes how to run docker images of TeamCity Server and TeamCity Agent, how to connect them, and how to build a project using TeamCity on docker images. &lt;/p&gt;

&lt;p&gt;This tutorial might need around 15-20 minutes, because we need time to pull images from Docker Hub repository.&lt;/p&gt;

&lt;p&gt;Here is an excellent &lt;strong&gt;free online tool&lt;/strong&gt; which allows to run this tutorial purely on web browser: &lt;strong&gt;&lt;a href="https://labs.play-with-docker.com/#" rel="noopener noreferrer"&gt;Play-With-Docker&lt;/a&gt;&lt;/strong&gt; 😆 . You need to &lt;strong&gt;register&lt;/strong&gt; for this tool, and then you can use this it to start this tutorial. &lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1️⃣: Run TeamCity Server in Docker container
&lt;/h2&gt;

&lt;p&gt;After you open &lt;a href="https://labs.play-with-docker.com/#" rel="noopener noreferrer"&gt;Play-With-Docker&lt;/a&gt;, you can click on &lt;code&gt;+ ADD NEW INSTANCE&lt;/code&gt; to start a terminal in a new node.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe8j8t6rbytwvf0lztiio.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe8j8t6rbytwvf0lztiio.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is how the terminal looks like in &lt;a href="https://labs.play-with-docker.com/#" rel="noopener noreferrer"&gt;Play-With-Docker&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft0rxc5hn7trc9j2uhozx.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft0rxc5hn7trc9j2uhozx.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For preparation, create folders by these commands:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

mkdir -p teamcity
mkdir teamcity/data
mkdir teamcity/logs
mkdir teamcity/agent


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The first thing is to set up TeamCity Server. We need to pull the server image from the Docker Hub repository. This might need a few minutes.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

docker pull jetbrains/teamcity-server


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We can view the images on the machine using this command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

docker images


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The TeamCity Server should be listed.&lt;/p&gt;

&lt;p&gt;Now, we can run this command to start a Docker container with TeamCity Server. &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

docker run -it -d --name server -u root -v /teamcity/data:/data/teamcity_server/datadir -v /teamcity/logs:/opt/teamcity/logs -p 8111:8111 jetbrains/teamcity-server


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here are explanations of the command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-d&lt;/code&gt; : Run in the background. We add this because we want to use only one terminal in Play-With-Docker. When you use your local machine, you can delete this. In that case, you need two terminals. One additional terminal for an agent, which will be introduced later.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--name server&lt;/code&gt; : We name this container "server".&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-u root&lt;/code&gt; : To run the command under 'root' user. This can be removed in your local machine when you login in as the root user.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-v /teamcity/data:/data/teamcity_server/datadir&lt;/code&gt; : We bound /teamcity/data folder in our machine with TeamCity Data Directory. When you execute the command on your own machine, please create or specify your own folder.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-v /teamcity/logs:/opt/teamcity/logs&lt;/code&gt; :  We bound /teamcity/logs folder in our machine with TeamCity logs. When you execute the command on your own machine, please create or specify your own folder.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-p 8111:8111&lt;/code&gt; : This is a map of the port between our machine and the container. You can use this command as &lt;code&gt;-p &amp;lt;host port&amp;gt;:8111&lt;/code&gt;, and specify your own perferred port on your local machine.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;jetbrains/teamcity-server&lt;/code&gt; : This is the name of the image.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This might also need a few minutes. After execution of the command, we can open port 8111 to see the page of TeamCity. In Play-With-Docker, click on &lt;code&gt;OPEN PORT&lt;/code&gt; and enter 8111 in the pop up window.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F22fus08ij00t7qlbnmcl.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F22fus08ij00t7qlbnmcl.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In your local machine, you can open the browser and access to &lt;code&gt;localhost:&amp;lt;host port&amp;gt;&lt;/code&gt; to see the page.  &lt;/p&gt;

&lt;p&gt;We can use this command to see the running Docker container.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

docker ps


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Step 2️⃣: Create a project and build steps in TeamCity
&lt;/h2&gt;

&lt;p&gt;After initialization, we click on proceed to start TeamCity for the first time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2hhr9syhdka9ublyv0xm.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2hhr9syhdka9ublyv0xm.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We keep the database type as default.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3753iz12ip9nwhav9fnd.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3753iz12ip9nwhav9fnd.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It might also need a few minutes to initialize TeamCity. Then, we accept the license agreement and continue to create administrator account. For this tutorial, we enter name &lt;code&gt;admin&lt;/code&gt; and password &lt;code&gt;admin&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fujj39yzqb6xe7x0yq5v5.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fujj39yzqb6xe7x0yq5v5.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we can add a project and create build steps for it. By clicking on the &lt;code&gt;create project&lt;/code&gt; button on the main page, we can add a project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1jieqgjws8hnl0x2wtcz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1jieqgjws8hnl0x2wtcz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this tutorial, we want to use TeamCity to automatically compile a java file when we build the project. Therefore, we create the project from a repository URL. I use a java hello world program from &lt;a href="https://github.com/Chen-Zidi/HelloWorld.git" rel="noopener noreferrer"&gt;my github repository&lt;/a&gt;. Since it is a public repository, the username and password can be left empty. We just proceed. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxe3ej9xejnduw0t13nnl.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxe3ej9xejnduw0t13nnl.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next page, we name the configuration as &lt;code&gt;compile java file&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuhuz7fhg3ojdcsf1z8w5.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuhuz7fhg3ojdcsf1z8w5.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We want TeamCity to automatically compile &lt;code&gt;HelloWorld.java&lt;/code&gt; for us when building the project. Therefore, in the next page for configuring build steps, we click on &lt;code&gt;configure build steps manually&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F54odcmw7t4vtlz8p9z8p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F54odcmw7t4vtlz8p9z8p.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; TeamCity can automatically detect build steps in the project. It supports to detect build steps in Maven，Gradle，Ant，NAnt，MSBuild，Powershell，Xcode，Rake，IntelliJ IDEA and so on.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We select runner type as &lt;code&gt;Command Line&lt;/code&gt;. Step name could be &lt;code&gt;compile&lt;/code&gt;. Custom script could be &lt;code&gt;javac HelloWorld.java&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8nbmjxcyqce6n0hjg21j.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8nbmjxcyqce6n0hjg21j.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; An interesting thing is that we can even create a docker image for our projects using TeamCity. TeamCity provides support for Docker. Details &lt;a href="https://www.jetbrains.com/help/teamcity/integrating-teamcity-with-docker.html#Requirements" rel="noopener noreferrer"&gt;here&lt;/a&gt;. Explore yourself if you are interested in it 😝!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Save the step and switch to &lt;code&gt;General Settings&lt;/code&gt;. Set the artifact path as &lt;code&gt;./&lt;/code&gt; to output the class file to current directory. Let's save the setting. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffipt3jq5q93gahrgz80e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffipt3jq5q93gahrgz80e.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 3️⃣: Run TeamCity Agent in Docker container
&lt;/h2&gt;

&lt;p&gt;After configuring the project and the build step, we need to create a &lt;a href="https://www.jetbrains.com/help/teamcity/build-agent.html" rel="noopener noreferrer"&gt;TeamCity Agent&lt;/a&gt;. TeamCity Agent is to listen to the commands from server and starts the actual build processes. Multiple agents can make parallel build steps possible.&lt;/p&gt;

&lt;p&gt;Run this command to pull TeamCity Minimal Agent Image:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

docker pull jetbrains/teamcity-minimal-agent


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; This image only provides minimal TeamCity Agent services. It is enough for this small example. Normally, you can use &lt;code&gt;jetbrains/teamcity-agent&lt;/code&gt; on your own machine.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then, we can start a Docker container with TeamCity Agent which tries to connect with the TeamCity Server.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

docker run -it -d -e SERVER_URL="http://server:8111" --link server -u root -v /teamcity/agent:/teamcity_agent/conf jetbrains/teamcity-minimal-agent


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In this command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-e SERVER_URL="http://server:8111"&lt;/code&gt; : Set the environment variable &lt;code&gt;SERVER_URL&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--link server&lt;/code&gt; : Add link to the container whose name is &lt;code&gt;server&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-v /teamcity/agent:/teamcity_agent/conf&lt;/code&gt; : Specify the path of the agent config folder.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;jetbrains/teamcity-minimal-agent&lt;/code&gt; : This is the name of the image.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 4️⃣: Build the project in TeamCity
&lt;/h2&gt;

&lt;p&gt;Back to the web page of TeamCity. Click on the &lt;code&gt;Agents&lt;/code&gt; on the top. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff8ua1ry22og4qha59cvp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff8ua1ry22og4qha59cvp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It might need a few minutes for the agent to show up. There should be one agent in the unauthorized category.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyh19150mtd7z1719abku.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyh19150mtd7z1719abku.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Authorize this agent. Then, there should be one connected agent with status idle.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fykw3j1wclcwtviraf9wd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fykw3j1wclcwtviraf9wd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to the projects page, we can find a &lt;code&gt;Run|...&lt;/code&gt; button in the &lt;code&gt;HelloWorld&lt;/code&gt; project. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsony1a2lgscrfpn55x4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsony1a2lgscrfpn55x4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the &lt;code&gt;...&lt;/code&gt; in &lt;code&gt;Run|...&lt;/code&gt;, and select the agent which we just created. Click on &lt;code&gt;Run build&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5d3rjngp0q5o1gy8p5wf.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5d3rjngp0q5o1gy8p5wf.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, we can see the project starts to build the steps that we just created.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5️⃣: Check output
&lt;/h2&gt;

&lt;p&gt;TeamCity needs a few seconds to complete the task. When the task is done, Under the &lt;code&gt;Run|...&lt;/code&gt; button, there is an &lt;code&gt;Artifacts&lt;/code&gt; link. When we place the mouse on it, we can see the list of artifacts. There should be a file &lt;code&gt;HelloWorld.class&lt;/code&gt;, which means our program has been complied. 😎 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbsx8rc76rm7e8939g89.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbsx8rc76rm7e8939g89.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this tutoiral, we use docker to create TeamCity Server and TeamCity Agent, and compile a java program in TeamCity. &lt;/p&gt;

&lt;p&gt;Learn more about how to use TeamCity &lt;a href="https://www.jetbrains.com/help/teamcity/teamcity-documentation.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Explore yourself with different possibilities and interesting news &lt;a href="https://blog.jetbrains.com/teamcity/category/news/" rel="noopener noreferrer"&gt;here&lt;/a&gt;. 💥&lt;/p&gt;

&lt;p&gt;Thanks for reading! ❤️&lt;/p&gt;

</description>
      <category>docker</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
