Host OS is docker, and docker on host works fine without root privileges. UID and GID in container are the same as on the host. If I log in to the agent, docker info works fine only with sudo, but not unprivileged: ERROR: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get dial unix /var/run/docker.sock: connect: permission denied When you run the agent for the first time, you should authorize it via the TeamCity server UI: go to the Unauthorized Agents page in your browser. Refer to our upgrade notes for information on possible affected use cases. storage/docker-volumes/teamcity/agent1/system:/opt/buildagent/system Since version 2020.1, TeamCity agent Docker images run under a non-root user. storage/docker-volumes/teamcity/agent1/plugins:/opt/buildagent/plugins storage/docker-volumes/teamcity/agent1/tools:/opt/buildagent/tools storage/docker-volumes/teamcity/agent1/temp:/opt/buildagent/temp storage/docker-volumes/teamcity/agent1/work:/opt/buildagent/work var/run/docker.sock:/var/run/docker.sock storage/docker-volumes/teamcity/agent1:/data/teamcity_agent/conf Image: jetbrains/teamcity-agent:2021.1.1-linux-sudo storage/docker-volumes/teamcity-pg:/var/lib/postgresql/data storage/docker-volumes/teamcity/logs:/opt/teamcity/logs storage/docker-volumes/teamcity/data:/data/teamcity_server/datadir My current docker-compose: version: '3.8' Same for me with different versions of agent. Check whether it has been installed and PATH environment variable contains path to it. INFO - Docker-compose is not available. Check whether docker daemon exists and it is up and running., INFO - Docker server info is not available. Logs: INFO - Docker client is available: 19.03.9, Running by root inside the container works fine. Running `docker info` in agent container by user buildagent user (default user in jetbrains/teamcity-agent) causes an error: ERROR: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get dial unix /var/run/docker.sock: connect: permission denied For using it locally, you need to run ssh-agent and supply it with a private key for authentication. To use it in Teamcity, other build system or even locally: Add a Build feature SSH Agent and chose a key you want to load to a local ssh-agent running at a build agent. Removing or adding "-privileged -e DOCKER_IN_DOCKER=start \" line does not affect. This key can be used in any of the RUN steps of Dockerfile. v /var/run/docker.sock:/var/run/docker.sock \ v /opt/buildagent/system:/opt/buildagent/system \ v /opt/buildagent/plugins:/opt/buildagent/plugins \ v /opt/buildagent/tools:/opt/buildagent/tools \ v /opt/buildagent/temp:/opt/buildagent/temp \ v /opt/buildagent/work:/opt/buildagent/work \ v /home/home/configs/teamcity-agent-conf:/data/teamcity_agent/conf \ One of the agent runs like this: docker run -d \ Agent works in docker, image jetbrains/teamcity-agent.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |