To run the container do:
docker-compose run --rm r
Once you have the container running, enter the command below in the R console to show some graphics
demo(graphics)
If you don't see anything, probably X11 does not have the permission to access the socket, so give it permission by running:
xhost +si:localuser:username
Run the container and demo(graphics)
again.