Skip to content

[🚀 Feature]: non-root user for selenium/video #2108

Closed
@vertexvaar

Description

@vertexvaar

Feature and motivation

I love using selenium for acceptance tests ❤️
I've setup github actions with docker-compose for my project to run acceptance tests. selenium/video:ffmpeg-6.1-20231219 starts and ends perfectly fine.
The complete test run is really long and will exceed 15 Minutes in the near future. So i came to think that it would be useful to only require failed tests and therefore control the recording from within the test runner.
I can start selenium/video from inside the container by mounting the docker socket and executing docker run ... where the tests are executed. I'm able to record each test in a single video. But i am not able to discard videos, as they are created by root:root and i am running a non-root container (uid/gid 1000). I tried to run with docker run -u1000, but that conflicts with supervisor: Error: Can't drop privilege as nonroot user.

Would it be possible to run the container as another user, so the resulting videos have the correct user uid/gid? I'd also be grateful if there is a guide how to build the image with uid/gid 1000 hardcoded, if running the container non-root is not possible.

Usage example

My docker run example would look like this:
docker run --rm -u1000 --network=foo-bar_default -v /virtualpath/projects/packages/foo-bar/.project/artifacts/videos/:/videos -e DISPLAY_CONTAINER_NAME=selenium-node-chrome -e FILE_NAME=chrome_video.mp4 selenium/video:ffmpeg-6.1-20231219

I can also imagin passing an environment variable or CMD argument to the container to control the effective user in the container.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions