2016-12-02 56 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

不要忘記,以紀念你的答案是正確的。 –

相關問題