Make shinyproxy user part of docker group in docker-compose.yml

Hello,
I am starting shinyproxy inside docker container along with other services in docker-compose.yml.
Everything works, except I could not figure out how to pass the --group-add command inside docker-compose.yml.
According to example this directive is needed:

--group-add $(getent group docker | cut -d: -f3)

I can add group-add to docker-compose.yml with docker group id on host machine (which is in my case 998), but this does not work.
What is the proper way of doing it?

We had success by using group_add in docker compose. You might try change undescore with dash:

  shiny-proxy:
    container_name: shiny-proxy
    build: ./
    depends_on:
      - redis
    group_add:
      - "997" # docker group for DIND

2 Likes