title: Add user to group inside Docker container
body: <p>How do I make sure a Docker user is added to a specific group when running a container? </p>
  
  <p>This is my situation. I'm running a Docker container where i need to access /dev/video0 which is owned by "root" and in group "video" on the host.</p>
  
  <p>My host UID is 1000 and gid=1000 and I'm in the "video" group (gid=44). When I run the following Docker run command, the user with gid=1000 inside the container isn't added to the video group. I have to execute a command inside the container to add the user to the video group and then everything works. </p>
  
  <pre><code>docker run \
    --name=cloud9 \
    -e PUID=1000 \
    -e PGID=1000 \
    -e TZ=US/Eastern \
    -p 8000:8000 \
    -v /home/pi/code:/code `#optional` \
    --group-add 44 \
    --device=/dev/video0 \
    --restart unless-stopped \
    linuxserver/cloud9
  </code></pre>
  
  <p>How do I add user with uid=1000 to group 44 ('video') directly from the run command?</p>