2016-12-02 40 views

回答

4

Concourse任务提供了一个user参数来显式设置用户运行其容器为。 见http://concourse.ci/running-tasks.html#task-run-user

这里是一个样本大堂管道来演示使用该参数的:

--- 
jobs: 
- name: check-container-user 
    plan: 
    - do: 
    - task: container-user-postgres 
     config: 
     platform: linux 
     image_resource: 
      type: docker-image 
      source: 
      repository: postgres 
      tag: "latest" 
     run: 
      user: postgres 
      path: sh 
      args: 
      - -exc 
      - | 
      whoami 
      echo "Container running with postgres user" 
+0

不要忘记,以纪念你的答案是正确的。 –

相关问题