The problem. I am trying to create a TeamCity infrastructure (a server and an agent) on Ubuntu Linux 16.04.1 LTS using Docker. I have run a Docker container with jetbrains/teamcity-server image as described on this page. It is possible to access the TeamCity server via web browser using the IP address of the server and port 8111.
Now I try to run a Docker container with an agent as described on this page. It is written: Note that "localhost" will not generally not work as that will refer to the "localhost" inside the container. Well, when I supply "http://localhost:8111", or "http://127.0.0.1:8111", or "http://my_server_ip:8111" to the running script for the agent container I finally get 1) "WARN - buildServer.AGENT.registration - Error registering on the server via URL http://localhost:8111 (sic! always localhost). Will continue repeating connection attempts.", or 2) "WARN - buildServer.AGENT.registration - Error while asking server for the communication protocols via URL http://localhost:8111/app/agents/protocols."
Also I have tried to reveal the IP address of the Docker container running the server and supply it for the agent running script. But the result was the same.
Question. What server URL I should provide? Are there any implicit steps in the TeamCity configuration with Docker which I miss?
Installing via Windows installerIn the TeamCity web UI, navigate to the Agents tab. Click the Install Build Agents link and select Windows Installer to download the installer. On the agent, run the agentInstaller.exe Windows Installer and follow the installation instructions.
TeamCity Docker Support can run on Windows, Linux, and macOS build agents. It uses the docker executable on the build agent machine, so it should be runnable by the build agent user.
You can use the --link
parameter to link containers:
jetbrains/teamcity-server
and use --name teamcity-server
to give it a descriptive name--link teamcity-server
to enable connectivity to the teamcity-server
containerteamcity-server
as the hostname to connect to the teamcity-server
containerPlease also check out Docker container networking which superseded the --link
feature.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With