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

Please expose `--privileged` flag in action.yaml config

Open meeDamian opened this issue 6 years ago • 7 comments

I want to setup a CPU emulation action for Docker, however I can't currently do that due to the lack of access to this flag.

meeDamian avatar Aug 17 '19 22:08 meeDamian

The —privileged flag is heavily dependent on the configuration of the underlying docker daemon and depending on the configuration for the particular runner it may or may not work.

chrispat avatar Nov 08 '19 02:11 chrispat

do you have any update? it would be very useful to pass down the --privileged option

iamenr0s avatar Aug 25 '20 23:08 iamenr0s

Hello guys,

I'm having the same issue. I have a docker container that is used as an build environment but need --privileged mode to be enabled.. Too bad, I cannot used GitHub actions and used this container to build other projects that needs it..

I will try to find another solution..

lion24 avatar Mar 21 '21 18:03 lion24

This behavior is very much needed. Currently a deal breaker for some of our CI systems.

brad-natelborg avatar Apr 27 '21 20:04 brad-natelborg

OK, just figured this out!

You need to add an "options: --privileged" to the CI yml under your container.

brad-natelborg avatar Apr 27 '21 20:04 brad-natelborg

You need to add an "options: --privileged" to the CI yml under your container.

Can you show an example of this in context?

ianfixes avatar Jun 03 '21 17:06 ianfixes

@ianfixes yep, sure thing.

smoke:
    name: Smoke Test MAX32665
    needs: [load, ci-image]
    runs-on: [self-hosted, linux, x64]

    # Run inside this container
    container:
      image: <docker image name>
      credentials:
        username: _json_key
        password: ${{ secrets.GCR_DEVOPS_SERVICE_ACCOUNT_KEY }}
      options: --privileged

    steps:
      - name: Check out the repo
        uses: actions/checkout@v2

brad-natelborg avatar Jun 03 '21 17:06 brad-natelborg

Hello! Apologies for the delay in responding to this issue. It looks like @brad-natelborg provided a solution for running a container in privileged mode within a workflow run :)

Regarding creating a container based action with the same configuration, as @chrispat mentioned, this is heavily dependent on the underlying docker daemon.

I am going to go ahead and close this out for the time being, but if there are additional questions please feel free to reopen!

ncalteen avatar Sep 01 '23 19:09 ncalteen

@brad-natelborg where do I specify this for a job which only uses a container in one step?

(This is for “slim” containers where the normal checkout action cannot run in the container because it has no nodejs.)

mirabilos avatar Dec 05 '23 04:12 mirabilos