I'm running the teamcity server with 2 agents, via docker, version : 2022.10.2-linux, in Windows 11 . In the agent parameters tab, I can see the docker version: 20.10.12 docker.version. It turns out that when I'm going to create a pipeline for my kotlin application (1.8), with gradle (7.6), I can't run because it has the following error: docker.server.version exists. I've searched some places on the internet but i don't know how to solve it. Could someone help?
the teamcity agent doesn't see the docker when using Qodana
957 views Asked by Rodrigo Batista At
2
There are 2 answers
2

I tried both options, but to no avail. My docker compose file
version: "3.9"
services:
teamcity_psql:
image: "postgres:15-alpine"
hostname: "teamcity_psql"
container_name: "teamcity_psql"
restart: "always"
environment:
POSTGRES_DB: "teamcity"
POSTGRES_USER: "user"
POSTGRES_PASSWORD: "***********"
ports:
- "5490:5432"
volumes:
- "teamcity_psql_data:/var/lib/postgresql/data"
networks:
teamcity_network:
ipv4_address: 172.19.0.2
teamcity_server:
image: jetbrains/teamcity-server:2022.10.2-linux
hostname: "teamcity_server"
container_name: "teamcity_server"
restart: "always"
ports:
- "8111:8111"
volumes:
- teamcity_server_data:/data/teamcity_server/datadir
- teamcity_server_log:/opt/teamcity/logs
depends_on:
- teamcity_psql
networks:
teamcity_network:
ipv4_address: 172.19.0.3
teamcity_agent_taurus:
image: jetbrains/teamcity-agent:2022.10.2-linux
hostname: "teamcity_agent_taurus"
container_name: "teamcity_agent_taurus"
restart: "always"
privileged: true
environment:
- SERVER_URL=http://172.19.0.3:8111
- OWN_ADDRESS=172.19.0.4
- OWN_PORT=9090
- AGENT_NAME=Taurus
- DOCKER_IN_DOCKER=start
volumes:
- teamcity_agent_taurus_conf:/data/teamcity_agent/conf
networks:
teamcity_network:
ipv4_address: 172.19.0.4
depends_on:
- teamcity_server
teamcity_agent_virgo:
image: jetbrains/teamcity-agent:2022.10.2-linux
hostname: "teamcity_agent_virgo"
container_name: "teamcity_agent_virgo"
restart: "always"
privileged: true
environment:
- SERVER_URL=http://172.19.0.3:8111
- OWN_ADDRESS=172.19.0.5
- OWN_PORT=9091
- AGENT_NAME=Virgo
- DOCKER_IN_DOCKER=start
volumes:
- teamcity_agent_virgo_conf:/data/teamcity_agent/conf
networks:
teamcity_network:
ipv4_address: 172.19.0.5
depends_on:
- teamcity_server
volumes:
teamcity_psql_data:
name: "teamcity_psql_data"
driver: "local"
teamcity_server_data:
name: "teamcity_server_data"
driver: "local"
teamcity_server_log:
name: "teamcity_server_log"
driver: "local"
teamcity_agent_taurus_conf:
name: "teamcity_agent_taurus_conf"
driver: "local"
teamcity_agent_virgo_conf:
name: "teamcity_agent_virgo_conf"
driver: "local"
networks:
teamcity_network:
name: "teamcity_network"
driver: "bridge"
ipam:
config:
- subnet: "172.19.0.0/16"
gateway: "172.19.0.1"
I assume some steps of your build configuration need docker so that build configuration should be executed on agent with docker installed. Adding docker dependent steps adds implicit requirement that agent configuration parameter
docker.server.version
exists. This parameter is set up automatically during agent's startup if docker is available. You run your TeamCity agent in docker container but there's no docker inside that container. Basically, you have two options: