Isaac ros common docker ros2 gpio permission

I’m trying to use GPIO pins with ros2 in the isaac ros common docker container but it runs into permission errors and I can’t run ros2 with sudo (and I don’t want to):

admin@ubuntu:/workspaces/isaac_ros-dev$ ros2 run gpio_test gpio_pwm
[ERROR] The current user does not have permissions set to access the library functionalites. Please configure permissions or use the root user to run this.
terminate called after throwing an instance of 'std::runtime_error'
  what():  [Exception] Permission Denied. (catched from: setmode())

[ros2run]: Aborted
admin@ubuntu:/workspaces/isaac_ros-dev$ sudo ros2 run gpio_test gpio_pwm
sudo: ros2: command not found

The arguments to the docker from here are:

docker run -it --rm \
    --privileged \
    --network host \
    ${DOCKER_ARGS[@]} \
    -v $ISAAC_ROS_DEV_DIR:/workspaces/isaac_ros-dev \
    -v /dev/*:/dev/* \
    -v /etc/localtime:/etc/localtime:ro \
    --name "$CONTAINER_NAME" \
    --runtime nvidia \
    --user="admin" \
    --entrypoint /usr/local/bin/scripts/workspace-entrypoint.sh \
    --workdir /workspaces/isaac_ros-dev \
    $@ \
    $BASE_NAME \
    /bin/bash

and inside the container I get:

$ id
uid=1000(admin) gid=1000(admin) groups=1000(admin),27(sudo),44(video),46(plugdev)

and inside /lib/udev/rules.d/ this file exists.

What do I do to get gpio working with ros2?

From the udev rules it looks like you have add the admin user of the docker container to the gpio group which results in the permission issue. Also, have a look at Running the container section from your referenced library which describes the necessary paths to be mounted inside the docker to access the GPIO pins.