Need some help, getting NodeJs runner to work on Docker Agent

Hi I am evaluating TeamCity at the moment. I have the Server running well and most of our maven based applications. However I am struggling to get NodeJs runner to work. I have tried many different docker agent configurations to get it to run. 

Here is a snipet of the docker compose used to start the agent:

teamcity-agent:
        image: jetbrains/teamcity-agent
        container_name: teamcity-agent1
        user: root
        environment:
            - "SERVER_URL=http://xxxx:8111"
            - "AGENT_NAME=Default Agent"
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
            - teamcity_agent1_conf:/data/teamcity_agent/conf
            - teamcity_agent1_work:/opt/buildagent/work
            - teamcity_agent1_temp:/opt/buildagent/temp
            - teamcity_agent1_tools:/opt/buildagent/tools
            - teamcity_agent1_plugins:/opt/buildagent/plugins
            - teamcity_agent1_system:/opt/buildagent/system
        restart: unless-stopped
        depends_on:
            - teamcity-server

However running a simple command of node --version like the image below gives and error:

Gives the following error.

Please help me get the configuration right. My next step is to have the agent on a physical box, so not installed via docker.

Thanks

David

0
1 comment

Hi,
It looks like you have your volumes mapped incorrectly. Please make sure you have the volumes mapped exactly like below (as described in https://hub.docker.com/r/jetbrains/teamcity-agent):

volumes:
            - /var/run/docker.sock:/var/run/docker.sock
            - /opt/buildagent/conf:/data/teamcity_agent/conf
            - /opt/buildagent/work:/opt/buildagent/work
            - /opt/buildagent/temp:/opt/buildagent/temp
            - /opt/buildagent/tools:/opt/buildagent/tools
            - /opt/buildagent/plugins:/opt/buildagent/plugins
            - /opt/buildagent/system:/opt/buildagent/system

Once you move to a non-docker agent, you can use whatever directories you wish. This is just a limitation of using the docker from your host.

Thanks,
Eric

0

Please sign in to leave a comment.