TeamCity on Linux with Docker
I'm using Docker to run TeamCity. Inside TeamCity I'm trying to run integration tests using containers.
I'm using docker-compose to run my tests.
If I use a compose file such as this:
=========================
version: '3'
services:
steve.core.data.sqlserver.tests.database:
image: microsoft/mssql-server-linux
environment:
- MSSQL_SA_PASSWORD=Password1
- ACCEPT_EULA=Y
- MSSQL_PID=Developer
ports:
- "1433:1433"
=========================
Should I expect the TeamCity agent to be able to access SQL Server using localhost:1433 as I would if I run Docker locally on my machine?
Thanks,
Steve.
Please sign in to leave a comment.
Hello Steve,
If you're starting docker compose using Docker Compose runner, then yes, subsequent build steps should be able to access localhost:1433
Hope this will work for you :)
Best,
KIR
Thanks Kirill - it didn't work though.
I had to open the parameters for my Agent (/agentDetails.html?id=17&tab=agentParameters) and use the address from ec2.local-ipv4 in place of localhost.
As you can tell, I'm running on AWS.
This was a bit of a fudge though - I'm running the tests directly in the Agent (outside of Docker) and just using Docker to host my dependencies for the tests.
I need to use this work around due to the issue I raised here: https://teamcity-support.jetbrains.com/hc/en-us/requests/1381002
The reason for the work around is because TeamCity isn't stopping the build when tests fail if I host everything in Docker containers using a compose file.
I'll update the other thread in a week once I've had chance to start looking at this again.