From e0c6f31a36c147810265bce6eb1a22a91c7b5bbe Mon Sep 17 00:00:00 2001 From: Yuri Lima Date: Tue, 9 Jun 2026 11:00:18 +0200 Subject: [PATCH] Update .env for new server and agent image versions; enhance docker-compose.yml with dynamic agent names and extra hosts; add troubleshooting guide for port allocation issues. --- .env | 6 +++++- TROUBLESHOOTING.md | 32 ++++++++++++++++++++++++++++++++ docker-compose.yml | 14 +++++++++++++- 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 TROUBLESHOOTING.md diff --git a/.env b/.env index 34ae2bf..8cbec4b 100644 --- a/.env +++ b/.env @@ -1 +1,5 @@ -AGENT_IMAGE_VERSION="2025.07.3-linux-sudo" \ No newline at end of file +SERVER_IMAGE_VERSION="2026.1.1-linux" +AGENT_IMAGE_VERSION="2026.1.1-linux-sudo" +AGENT_NAME_1="master-agent" +AGENT_NAME_2="bbc-agent" +AGENT_NAME_3="dev-test-agent" \ No newline at end of file diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md new file mode 100644 index 0000000..7459775 --- /dev/null +++ b/TROUBLESHOOTING.md @@ -0,0 +1,32 @@ +# Troubleshooting + +## Port 55432 Already Allocated (E2E Builds) + +**Symptom:** +A build step like "Postgres Up" fails with: + +``` +Bind for 0.0.0.0:55432 failed: port is already allocated +``` + +**Cause:** +A Postgres container from a previous build was not cleaned up properly (e.g. build failed before reaching its teardown step). Since all E2E builds use the same hardcoded host port `55432`, the stale container blocks any new build from starting. + +**Diagnosis:** + +```bash +# Find what's holding the port +docker ps --filter "publish=55432" --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" +``` + +**Fix:** + +```bash +# Remove the stale container (replace the name with the one from the command above) +docker rm -f +``` + +Then re-run the failed build. + +**Prevention:** +Ensure every build configuration runs `docker compose down -v` in a cleanup/always-run step so containers are torn down even when earlier steps fail. diff --git a/docker-compose.yml b/docker-compose.yml index f653f86..8f2a815 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: - '/teamcity/logs:/opt/teamcity/logs' networks: - devops - image: jetbrains/teamcity-server + image: jetbrains/teamcity-server:${SERVER_IMAGE_VERSION} teamcity-agent-1: restart: always @@ -23,10 +23,14 @@ services: environment: - 'SERVER_URL=teamcity-server:8111' - DOCKER_IN_DOCKER=start + - AGENT_NAME=${AGENT_NAME_1} user: root privileged: true networks: - devops + extra_hosts: + - "host.docker.internal:host-gateway" + - "phoenixDBE2E:host-gateway" volumes: - '/teamcity/agent:/teamcity_agent/conf' - '/var/run/docker.sock:/var/run/docker.sock' @@ -42,10 +46,14 @@ services: environment: - 'SERVER_URL=teamcity-server:8111' - DOCKER_IN_DOCKER=start + - AGENT_NAME=${AGENT_NAME_2} user: root privileged: true networks: - devops + extra_hosts: + - "host.docker.internal:host-gateway" + - "phoenixDBE2E:host-gateway" volumes: - '/teamcity/agent2:/teamcity_agent/conf' - '/var/run/docker.sock:/var/run/docker.sock' @@ -62,10 +70,14 @@ services: environment: - 'SERVER_URL=teamcity-server:8111' - DOCKER_IN_DOCKER=start + - AGENT_NAME=${AGENT_NAME_3} user: root privileged: true networks: - devops + extra_hosts: + - "host.docker.internal:host-gateway" + - "phoenixDBE2E:host-gateway" volumes: - '/teamcity/agent3:/teamcity_agent/conf' - '/var/run/docker.sock:/var/run/docker.sock'