最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

TeamCity: How can I execute a build step inside a Docker image as a non-root user, while the agent itself is running in Docker?

programmeradmin3浏览0评论

When trying to setup a build step to run within node:lts image, I get this:

Unmet requirements:

  • docker.server.osType contains linux
  • docker.server.osType exists

I got it working by adding user: root

teamcity-agent-1:
    image: jetbrains/teamcity-agent:2024.12
    container_name: teamcity-agent-1
    depends_on:
      - teamcity-server
    environment:
      - SERVER_URL=http://teamcity-server:8111
    user: root
    volumes:
      - tc_agent_1_data:/data/teamcity_agent
      - /var/run/docker.sock:/var/run/docker.sock

Now I don't like this approach, it's not wise from a security perspective.

The problem seems to be related to a mismatch between docker group GID on my host machine and the agent image. Running "getent group docker" I get

  • inside host: "docker:x:988:USER-NAME"
  • inside agent: "docker:x:999:buildagent"

Have you encountered this before ?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论