Currently I have something like the following in a script:
DOCKER_GROUP_ID=$(cut -d: -f3 < <(getent group docker))
...
docker run --group-add ${DOCKER_GROUP_ID} ...
Problem is when I run this script, I get messages like the following in the resultant container all the time:
groups: cannot find name for group ID 999
Solution:
Based on the answer from @TarunLalwani I have the following in my script:
DOCKER_GROUP_ID=$(cut -d: -f3 < <(getent group docker))
CMD="docker run -d \
--group-add ${DOCKER_GROUP_ID} \
${IDEA_IMAGE}"
echo $CMD
CONTAINER=$($CMD)
# Post-configuration
docker exec --user=root -it $CONTAINER groupadd -g $DOCKER_GROUP_ID docker
docker attach $CONTAINER