Skip to content

Instantly share code, notes, and snippets.

@jonaslimads
Last active June 5, 2021 03:08
Show Gist options
  • Save jonaslimads/a016fa12a648e6b966d395be29402903 to your computer and use it in GitHub Desktop.
Save jonaslimads/a016fa12a648e6b966d395be29402903 to your computer and use it in GitHub Desktop.
Plot R graphics through Docker
version: '3.8'
services:
# The service below does the same as:
# docker run -i -t --rm -e DISPLAY=$DISPLAY -u docker -v /tmp/.X11-unix:/tmp/.X11-unix:ro --name="r" rocker/r-base
#
# which can be run with:
# docker-compose run --rm r
r:
image: rocker/r-base
container_name: r
stdin_open: true # docker run -i
tty: true # docker run -t
user: docker
environment:
- DISPLAY=$DISPLAY
volumes:
- "/tmp/.X11-unix:/tmp/.X11-unix:ro"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment