JetBrains / teamcity-docker-agent

TeamCity agent docker image sources
https://hub.docker.com/r/jetbrains/teamcity-agent/
Apache License 2.0
77 stars 64 forks source link

Adding docker-compose to agent #3

Closed bduisenov closed 6 years ago

bduisenov commented 7 years ago

Hi, I'm running some integration tests through gradle which in turn start docker-compose services. As for now, I'm getting an error during the build which tells that docker-compose was not found.

How do I install docker-compose command into TC agent?

VladRassokhin commented 7 years ago

You can create your own docker image based on 'jetbrains/teamcity-agent' one with software you need.

bduisenov commented 7 years ago

@VladRassokhin thanks for a quick response. I'm currently in the process of doing this. Do you have this in roadmap?

VladRassokhin commented 7 years ago

No, so far there's no plan to include docker-compose into image.

fouadroumieh commented 6 years ago

Can someone please elaborate on how to solve this issue? because I'm getting the same.

VladRassokhin commented 6 years ago

@fouadroumieh create new docker image based on jetbrains/teamcity-agent:latest one with additional RUN steps which would install docker-compose.

fouadroumieh commented 6 years ago

@VladRassokhin I managed to install docker-compose, but now the step goes always successful after execution, even if I put wrong yml file name!

dhatawesomedude commented 6 years ago

@fouadroumieh did you make any progress with this?

fouadroumieh commented 6 years ago

@dhatawesomedude not really, it was kind of PoC work and I didn't go further with that.

marat-safin commented 6 years ago

In case if you are still looking for solution, here is my variant. I added compose to agent like this:

FROM jetbrains/teamcity-agent

# Install compose
RUN curl -L https://github.com/docker/compose/releases/download/1.13.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && \
    chmod +x /usr/local/bin/docker-compose 
stokito commented 6 years ago

I also thought that if Docker is supported then Docker compose should be too. But on agent's page in "Incompatible configurations" I see my build with note: "Unmet requirements: dockerCompose.version exists".

I solved the problem by manually installing docker compose inside agent container:

# login to agent container bash
docker exec -it tc_agent /bin/sh
# install docker-compose
apt-get install docker-compose
# now exit back to host machine
exit
# now lets restart it so tc server will reread it
docker restart tc_agent

You might need to go to agents page and authorize the agent again.

Hope this helps

VladRassokhin commented 6 years ago

Ok, since we do have support for docker-compose in TeamCity it makes sense to add it into docker images. Will do that for TeamCity 2018.1

nevmerzhitsky commented 6 years ago

I like @stokito version and have converted it to Dockerfile form:

FROM jetbrains/teamcity-agent

RUN set -ex; \
    apt-get update -y; \
    apt-get install -y --no-install-recommends \
        docker-compose \
    ; \
    rm -rf /var/lib/apt/lists/*

Right now this installs 1.8.0 version of Compose. Don't forget that 1.8 version is obsolete crap.