container-action icon indicating copy to clipboard operation
container-action copied to clipboard

Specify container uid and gid

Open mtcolman opened this issue 4 years ago • 0 comments

Can it be made possible to specify user and group to be used in the docker run command?

Such as using an options command?

name: 'Container Action Template'
description: 'Get started with Container actions'
author: 'GitHub'
inputs: 
  myInput:
    description: 'Input to use'
    default: 'world'
runs:
  using: 'docker'
  image: 'Dockerfile'
  options: --user 1000:1000
  args:
    - ${{ inputs.myInput }}

My use case is as follows: We have a container where we specify the user (uid=1000,gid=1000) and one of the workflow steps we wish for is to start the container up and send some args to it. If it's successful, we know the PR hasn't broken it.

However when using container-action github is starting the container and mounting workspace, workflow, home etc as uid=1001 and gid=121 and therefore our user (who is non-root) cannot then perform actions in a script.

Thanks,

Matt

mtcolman avatar Aug 23 '21 14:08 mtcolman